netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net] vlan: allow to change type when no vlan device is hooked on netdev
@ 2012-10-17 11:37 Jiri Pirko
  2012-10-17 16:06 ` Jon Stanley
  2012-10-18 19:35 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2012-10-17 11:37 UTC (permalink / raw)
  To: netdev; +Cc: davem, fubar, andy, kaber, jstanley

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch net] vlan: allow to change type when no vlan device is hooked on netdev
  2012-10-17 11:37 [patch net] vlan: allow to change type when no vlan device is hooked on netdev Jiri Pirko
@ 2012-10-17 16:06 ` Jon Stanley
  2012-10-18 19:35 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Stanley @ 2012-10-17 16:06 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, fubar, andy, kaber

On Wed, Oct 17, 2012 at 7:37 AM, Jiri Pirko <jiri@resnulli.us> 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!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch net] vlan: allow to change type when no vlan device is hooked on netdev
  2012-10-17 11:37 [patch net] vlan: allow to change type when no vlan device is hooked on netdev Jiri Pirko
  2012-10-17 16:06 ` Jon Stanley
@ 2012-10-18 19:35 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-10-18 19:35 UTC (permalink / raw)
  To: jiri; +Cc: netdev, fubar, andy, kaber, jstanley

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 <jstanley@rmrf.net>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-18 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-17 11:37 [patch net] vlan: allow to change type when no vlan device is hooked on netdev Jiri Pirko
2012-10-17 16:06 ` Jon Stanley
2012-10-18 19:35 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).