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 | |
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')
-rw-r--r-- | net/ipv4/af_inet.c | 5 | ||||
-rw-r--r-- | net/ipv4/udplite.c | 1 |
2 files changed, 1 insertions, 5 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 | } |
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index 470c504b9554..66f79513f4a5 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c | |||
@@ -64,7 +64,6 @@ static struct inet_protosw udplite4_protosw = { | |||
64 | .protocol = IPPROTO_UDPLITE, | 64 | .protocol = IPPROTO_UDPLITE, |
65 | .prot = &udplite_prot, | 65 | .prot = &udplite_prot, |
66 | .ops = &inet_dgram_ops, | 66 | .ops = &inet_dgram_ops, |
67 | .capability = -1, | ||
68 | .no_check = 0, /* must checksum (RFC 3828) */ | 67 | .no_check = 0, /* must checksum (RFC 3828) */ |
69 | .flags = INET_PROTOSW_PERMANENT, | 68 | .flags = INET_PROTOSW_PERMANENT, |
70 | }; | 69 | }; |