[NET]: Make the device list and device lookups per namespace.
[deliverable/linux.git] / drivers / net / bonding / bond_sysfs.c
index 878f7aabeeac2b1a27324e3a2a89bef0371343c4..8289e27a360a399f7b9a29405ba1468289446ffa 100644 (file)
@@ -22,7 +22,6 @@
  */
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/sysdev.h>
 #include <linux/fs.h>
@@ -36,6 +35,7 @@
 #include <linux/ctype.h>
 #include <linux/inet.h>
 #include <linux/rtnetlink.h>
+#include <net/net_namespace.h>
 
 /* #define BONDING_DEBUG 1 */
 #include "bonding.h"
@@ -165,9 +165,9 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
                                printk(KERN_INFO DRV_NAME
                                        ": %s is being deleted...\n",
                                        bond->dev->name);
-                               unregister_netdevice(bond->dev);
                                bond_deinit(bond->dev);
                                bond_destroy_sysfs_entry(bond);
+                               unregister_netdevice(bond->dev);
                                rtnl_unlock();
                                goto out;
                        }
@@ -300,7 +300,7 @@ static ssize_t bonding_store_slaves(struct device *d,
                read_unlock_bh(&bond->lock);
                printk(KERN_INFO DRV_NAME ": %s: Adding slave %s.\n",
                       bond->dev->name, ifname);
-               dev = dev_get_by_name(ifname);
+               dev = dev_get_by_name(&init_net, ifname);
                if (!dev) {
                        printk(KERN_INFO DRV_NAME
                               ": %s: Interface %s does not exist!\n",
This page took 0.02664 seconds and 5 git commands to generate.