diff options
author | Eric Paris <eparis@redhat.com> | 2009-11-05 23:44:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-06 00:40:17 -0500 |
commit | 13f18aa05f5abe135f47b6417537ae2b2fedc18c (patch) | |
tree | 3bcf8c52bd9d957fd09a87224c9d44566071f981 /net/ipv4/af_inet.c | |
parent | 89794a6f3bf6db552b1ff4d2ad42fdd8739ac2a2 (diff) |
net: drop capability from protocol definitions
struct can_proto had a capability field which wasn't ever used. It is
dropped entirely.
struct inet_protosw had a capability field which can be more clearly
expressed in the code by just checking if sock->type = SOCK_RAW.
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 538e84d0bcba..180ec4c94919 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -325,7 +325,7 @@ lookup_protocol: | |||
325 | } | 325 | } |
326 | 326 | ||
327 | err = -EPERM; | 327 | err = -EPERM; |
328 | if (answer->capability > 0 && !capable(answer->capability)) | 328 | if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW)) |
329 | goto out_rcu_unlock; | 329 | goto out_rcu_unlock; |
330 | 330 | ||
331 | err = -EAFNOSUPPORT; | 331 | err = -EAFNOSUPPORT; |
@@ -947,7 +947,6 @@ static struct inet_protosw inetsw_array[] = | |||
947 | .protocol = IPPROTO_TCP, | 947 | .protocol = IPPROTO_TCP, |
948 | .prot = &tcp_prot, | 948 | .prot = &tcp_prot, |
949 | .ops = &inet_stream_ops, | 949 | .ops = &inet_stream_ops, |
950 | .capability = -1, | ||
951 | .no_check = 0, | 950 | .no_check = 0, |
952 | .flags = INET_PROTOSW_PERMANENT | | 951 | .flags = INET_PROTOSW_PERMANENT | |
953 | INET_PROTOSW_ICSK, | 952 | INET_PROTOSW_ICSK, |
@@ -958,7 +957,6 @@ static struct inet_protosw inetsw_array[] = | |||
958 | .protocol = IPPROTO_UDP, | 957 | .protocol = IPPROTO_UDP, |
959 | .prot = &udp_prot, | 958 | .prot = &udp_prot, |
960 | .ops = &inet_dgram_ops, | 959 | .ops = &inet_dgram_ops, |
961 | .capability = -1, | ||
962 | .no_check = UDP_CSUM_DEFAULT, | 960 | .no_check = UDP_CSUM_DEFAULT, |
963 | .flags = INET_PROTOSW_PERMANENT, | 961 | .flags = INET_PROTOSW_PERMANENT, |
964 | }, | 962 | }, |
@@ -969,7 +967,6 @@ static struct inet_protosw inetsw_array[] = | |||
969 | .protocol = IPPROTO_IP, /* wild card */ | 967 | .protocol = IPPROTO_IP, /* wild card */ |
970 | .prot = &raw_prot, | 968 | .prot = &raw_prot, |
971 | .ops = &inet_sockraw_ops, | 969 | .ops = &inet_sockraw_ops, |
972 | .capability = CAP_NET_RAW, | ||
973 | .no_check = UDP_CSUM_DEFAULT, | 970 | .no_check = UDP_CSUM_DEFAULT, |
974 | .flags = INET_PROTOSW_REUSE, | 971 | .flags = INET_PROTOSW_REUSE, |
975 | } | 972 | } |