diff options
| author | Jiri Pirko <jiri@resnulli.us> | 2012-10-16 21:37:36 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-10-18 15:34:30 -0400 |
| commit | 18c22a03a2187bcbda7d3a7fa1061584a6348e7b (patch) | |
| tree | 4a6470d51268e35cca14a868e8a66786ae59d96c | |
| parent | 0ca7111a38f053ae7b8829ee32fca6f9ef47550a (diff) | |
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>
| -rw-r--r-- | net/8021q/vlan.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 9096bcb08132..ee070722a3a3 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
| @@ -463,7 +463,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, | |||
| 463 | 463 | ||
| 464 | case NETDEV_PRE_TYPE_CHANGE: | 464 | case NETDEV_PRE_TYPE_CHANGE: |
| 465 | /* Forbid underlaying device to change its type. */ | 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 | case NETDEV_NOTIFY_PEERS: | 470 | case NETDEV_NOTIFY_PEERS: |
| 469 | case NETDEV_BONDING_FAILOVER: | 471 | case NETDEV_BONDING_FAILOVER: |
