[patch net] vlan: allow to change type when no vlan device is hooked on netdev

Subsystems: networking [general], the rest

STALE5105d

3 messages, 3 authors, 2012-10-18 · open the first message on its own page

[patch net] vlan: allow to change type when no vlan device is hooked on netdev

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-10-17 11:37:44

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 <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/8021q/vlan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
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:
-- 
1.7.11.4

Re: [patch net] vlan: allow to change type when no vlan device is hooked on netdev

From: Jon Stanley <hidden>
Date: 2012-10-17 16:06:34

On Wed, Oct 17, 2012 at 7:37 AM, Jiri Pirko [off-list ref] wrote:
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.
Confirmed to work, thanks!

Re: [patch net] vlan: allow to change type when no vlan device is hooked on netdev

From: David Miller <davem@davemloft.net>
Date: 2012-10-18 19:35:42

From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 17 Oct 2012 13:37:36 +0200
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 <redacted>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Applied and queued up for -stable, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help