From: Jiri Pirko Date: Wed, 17 Oct 2012 01:37:36 +0000 (+0000) Subject: vlan: allow to change type when no vlan device is hooked on netdev X-Git-Tag: v3.7-rc3~7^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18c22a03a2187bcbda7d3a7fa1061584a6348e7b;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 9096bcb..ee07072 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, 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: