diff options
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 | } |