Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
[linux-2.6-microblaze.git] / net / core / sock.c
index 0510826..90509c3 100644 (file)
@@ -574,7 +574,7 @@ static int sock_setbindtodevice_locked(struct sock *sk, int ifindex)
 
        /* Sorry... */
        ret = -EPERM;
-       if (!ns_capable(net->user_ns, CAP_NET_RAW))
+       if (sk->sk_bound_dev_if && !ns_capable(net->user_ns, CAP_NET_RAW))
                goto out;
 
        ret = -EINVAL;