net: pass kern to net_proto_family create function
[firefly-linux-kernel-4.4.55.git] / net / ipv6 / af_inet6.c
index 9105b25defe5b479f9a8554ed155f333d644d522..45ed5e05ab329017d10aefbf26ba326886e5ccc1 100644 (file)
@@ -95,7 +95,8 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
        return (struct ipv6_pinfo *)(((u8 *)sk) + offset);
 }
 
-static int inet6_create(struct net *net, struct socket *sock, int protocol)
+static int inet6_create(struct net *net, struct socket *sock, int protocol,
+                       int kern)
 {
        struct inet_sock *inet;
        struct ipv6_pinfo *np;
@@ -158,7 +159,7 @@ lookup_protocol:
        }
 
        err = -EPERM;
-       if (answer->capability > 0 && !capable(answer->capability))
+       if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW))
                goto out_rcu_unlock;
 
        sock->ops = answer->ops;