Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
[firefly-linux-kernel-4.4.55.git] / net / core / rtnetlink.c
index eaa057f14bcd4a7b4506709acbb090f0122bf4b4..9cf6fe9ddc0c99e189916dee672d16e6c4efe19a 100644 (file)
@@ -367,11 +367,10 @@ static void rtnl_lock_unregistering_all(void)
 {
        struct net *net;
        bool unregistering;
-       DEFINE_WAIT(wait);
+       DEFINE_WAIT_FUNC(wait, woken_wake_function);
 
+       add_wait_queue(&netdev_unregistering_wq, &wait);
        for (;;) {
-               prepare_to_wait(&netdev_unregistering_wq, &wait,
-                               TASK_UNINTERRUPTIBLE);
                unregistering = false;
                rtnl_lock();
                for_each_net(net) {
@@ -383,9 +382,10 @@ static void rtnl_lock_unregistering_all(void)
                if (!unregistering)
                        break;
                __rtnl_unlock();
-               schedule();
+
+               wait_woken(&wait, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
        }
-       finish_wait(&netdev_unregistering_wq, &wait);
+       remove_wait_queue(&netdev_unregistering_wq, &wait);
 }
 
 /**
@@ -1523,6 +1523,7 @@ static int do_setlink(const struct sk_buff *skb,
                        goto errout;
                }
                if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) {
+                       put_net(net);
                        err = -EPERM;
                        goto errout;
                }
@@ -2367,6 +2368,11 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
                return err;
        }
 
+       if (vid) {
+               pr_info("%s: vlans aren't supported yet for dev_uc|mc_add()\n", dev->name);
+               return err;
+       }
+
        if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
                err = dev_uc_add_excl(dev, addr);
        else if (is_multicast_ether_addr(addr))