net: Support specifying the network namespace upon device creation.
[deliverable/linux.git] / drivers / net / macvlan.c
index 3aabfd9dd2121d7eaab6a7f30e2113e4bc0d22c4..d7dba3f6f7637f510b8c6ba371def08697af19aa 100644 (file)
@@ -504,7 +504,7 @@ static int macvlan_get_tx_queues(struct net *net,
        return 0;
 }
 
-static int macvlan_newlink(struct net_device *dev,
+static int macvlan_newlink(struct net *src_net, struct net_device *dev,
                           struct nlattr *tb[], struct nlattr *data[])
 {
        struct macvlan_dev *vlan = netdev_priv(dev);
@@ -515,7 +515,7 @@ static int macvlan_newlink(struct net_device *dev,
        if (!tb[IFLA_LINK])
                return -EINVAL;
 
-       lowerdev = __dev_get_by_index(dev_net(dev), nla_get_u32(tb[IFLA_LINK]));
+       lowerdev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
        if (lowerdev == NULL)
                return -ENODEV;
 
@@ -555,13 +555,13 @@ static int macvlan_newlink(struct net_device *dev,
        return 0;
 }
 
-static void macvlan_dellink(struct net_device *dev)
+static void macvlan_dellink(struct net_device *dev, struct list_head *head)
 {
        struct macvlan_dev *vlan = netdev_priv(dev);
        struct macvlan_port *port = vlan->port;
 
        list_del(&vlan->list);
-       unregister_netdevice(dev);
+       unregister_netdevice_queue(dev, head);
 
        if (list_empty(&port->vlans))
                macvlan_port_destroy(port->dev);
@@ -601,7 +601,7 @@ static int macvlan_device_event(struct notifier_block *unused,
                break;
        case NETDEV_UNREGISTER:
                list_for_each_entry_safe(vlan, next, &port->vlans, list)
-                       macvlan_dellink(vlan->dev);
+                       macvlan_dellink(vlan->dev, NULL);
                break;
        }
        return NOTIFY_DONE;
This page took 0.029109 seconds and 5 git commands to generate.