Skip to content

Commit 18c22a0

Browse files
jpirkodavem330
authored andcommitted
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>
1 parent 0ca7111 commit 18c22a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/8021q/vlan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
463463

464464
case NETDEV_PRE_TYPE_CHANGE:
465465
/* Forbid underlaying device to change its type. */
466-
return NOTIFY_BAD;
466+
if (vlan_uses_dev(dev))
467+
return NOTIFY_BAD;
468+
break;
467469

468470
case NETDEV_NOTIFY_PEERS:
469471
case NETDEV_BONDING_FAILOVER:

0 commit comments

Comments
 (0)