Skip to content

Commit

Permalink
vlan: allow to change type when no vlan device is hooked on netdev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Oct 18, 2012
1 parent 0ca7111 commit 18c22a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,

case NETDEV_PRE_TYPE_CHANGE:
/* Forbid underlaying device to change its type. */
return NOTIFY_BAD;
if (vlan_uses_dev(dev))
return NOTIFY_BAD;
break;

case NETDEV_NOTIFY_PEERS:
case NETDEV_BONDING_FAILOVER:
Expand Down

0 comments on commit 18c22a0

Please sign in to comment.