[VLAN]: Handle vlan devices net namespace changing.
When van device is moved to another namespace proc files, related to this device, should also change one. Use the netdev REGISTER and UNREGISTER event handlers for this. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
65d292a2ef
commit
30688a9a3e
|
@ -154,8 +154,6 @@ void unregister_vlan_dev(struct net_device *dev)
|
||||||
grp = __vlan_find_group(real_dev);
|
grp = __vlan_find_group(real_dev);
|
||||||
BUG_ON(!grp);
|
BUG_ON(!grp);
|
||||||
|
|
||||||
vlan_proc_rem_dev(dev);
|
|
||||||
|
|
||||||
/* Take it out of our own structures, but be sure to interlock with
|
/* Take it out of our own structures, but be sure to interlock with
|
||||||
* HW accelerating devices or SW vlan input packet processing.
|
* HW accelerating devices or SW vlan input packet processing.
|
||||||
*/
|
*/
|
||||||
|
@ -278,9 +276,6 @@ int register_vlan_dev(struct net_device *dev)
|
||||||
if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
|
if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
|
||||||
real_dev->vlan_rx_add_vid(real_dev, vlan_id);
|
real_dev->vlan_rx_add_vid(real_dev, vlan_id);
|
||||||
|
|
||||||
if (vlan_proc_add_dev(dev) < 0)
|
|
||||||
pr_warning("8021q: failed to add proc entry for %s\n",
|
|
||||||
dev->name);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_free_group:
|
out_free_group:
|
||||||
|
@ -396,6 +391,14 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)
|
||||||
pr_warning("8021q: failed to change proc name for %s\n",
|
pr_warning("8021q: failed to change proc name for %s\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
break;
|
break;
|
||||||
|
case NETDEV_REGISTER:
|
||||||
|
if (vlan_proc_add_dev(dev) < 0)
|
||||||
|
pr_warning("8021q: failed to add proc entry for %s\n",
|
||||||
|
dev->name);
|
||||||
|
break;
|
||||||
|
case NETDEV_UNREGISTER:
|
||||||
|
vlan_proc_rem_dev(dev);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue