mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
netns: keep vlan slaves on master netns move
previously, if a vlan master device was moved from one network namespace to another, all 802.1q and macvlan slaves were deleted. we can use dev->reg_state to figure out whether dev_change_net_namespace is happening, since that won't set dev->reg_state NETREG_UNREGISTERING. so, this changes 8021q and macvlan to ignore NETDEV_UNREGISTER when reg_state is not NETREG_UNREGISTERING. Signed-off-by: David Lamparter <[email protected]> Reviewed-by: "Eric W. Biederman" <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Acked-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
b71c7aaa1e
commit
3b27e10555
3 changed files with 12 additions and 0 deletions
|
|
@ -525,6 +525,10 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
|
|||
break;
|
||||
|
||||
case NETDEV_UNREGISTER:
|
||||
/* twiddle thumbs on netns device moves */
|
||||
if (dev->reg_state != NETREG_UNREGISTERING)
|
||||
break;
|
||||
|
||||
/* Delete all VLANs for this dev. */
|
||||
grp->killall = 1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue