Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vlan: allow to change type when no vlan device is hooked on netdev

vlan_info might be present but still no vlan devices might be there.
That is in case of vlan0 automatically added.

So in that case, allow to change netdev type.

Reported-by: Jon Stanley <jstanley@rmrf.net>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jiri Pirko and committed by
David S. Miller
18c22a03 0ca7111a

+3 -1
+3 -1
net/8021q/vlan.c
··· 463 463 464 464 case NETDEV_PRE_TYPE_CHANGE: 465 465 /* Forbid underlaying device to change its type. */ 466 - return NOTIFY_BAD; 466 + if (vlan_uses_dev(dev)) 467 + return NOTIFY_BAD; 468 + break; 467 469 468 470 case NETDEV_NOTIFY_PEERS: 469 471 case NETDEV_BONDING_FAILOVER: