if (new_dev == NULL)
return -ENOBUFS;
+ dev_net_set(new_dev, net);
/* need 4 bytes for extra VLAN header info,
* hope the underlying device can handle it.
*/
int i, flgs;
struct net_device *vlandev;
- if (dev_net(dev) != &init_net)
- return NOTIFY_DONE;
-
if (is_vlan_dev(dev)) {
__vlan_device_event(dev, event);
goto out;
case GET_VLAN_REALDEV_NAME_CMD:
case GET_VLAN_VID_CMD:
err = -ENODEV;
- dev = __dev_get_by_name(&init_net, args.device1);
+ dev = __dev_get_by_name(net, args.device1);
if (!dev)
goto out;
struct vlan_net *vn;
vn = net_generic(net, vlan_net_id);
+ rtnl_kill_links(net, &vlan_link_ops);
vlan_proc_cleanup(net);
kfree(vn);
}
struct net_device_stats *stats;
unsigned short vlan_TCI;
- if (dev_net(dev) != &init_net)
- goto err_free;
-
skb = skb_share_check(skb, GFP_ATOMIC);
if (skb == NULL)
goto err_free;
if (!tb[IFLA_LINK])
return -EINVAL;
- real_dev = __dev_get_by_index(&init_net, nla_get_u32(tb[IFLA_LINK]));
+ real_dev = __dev_get_by_index(dev_net(dev), nla_get_u32(tb[IFLA_LINK]));
if (!real_dev)
return -ENODEV;