net: Support specifying the network namespace upon device creation.
[deliverable/linux.git] / net / 8021q / vlan_netlink.c
index 343146e1bceb0998e1b2a0804b5a798944669ea5..3c9cf6a8e7fbc9ca710cc39426fc235ca4b77a87 100644 (file)
@@ -119,7 +119,7 @@ static int vlan_get_tx_queues(struct net *net,
        return 0;
 }
 
-static int vlan_newlink(struct net_device *dev,
+static int vlan_newlink(struct net *src_net, struct net_device *dev,
                        struct nlattr *tb[], struct nlattr *data[])
 {
        struct vlan_dev_info *vlan = vlan_dev_info(dev);
@@ -131,7 +131,7 @@ static int vlan_newlink(struct net_device *dev,
 
        if (!tb[IFLA_LINK])
                return -EINVAL;
-       real_dev = __dev_get_by_index(dev_net(dev), nla_get_u32(tb[IFLA_LINK]));
+       real_dev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
        if (!real_dev)
                return -ENODEV;
 
@@ -169,6 +169,7 @@ static size_t vlan_get_size(const struct net_device *dev)
        struct vlan_dev_info *vlan = vlan_dev_info(dev);
 
        return nla_total_size(2) +      /* IFLA_VLAN_ID */
+              sizeof(struct ifla_vlan_flags) + /* IFLA_VLAN_FLAGS */
               vlan_qos_map_size(vlan->nr_ingress_mappings) +
               vlan_qos_map_size(vlan->nr_egress_mappings);
 }
This page took 0.038043 seconds and 5 git commands to generate.