Skip to contentSkip to conversation

vlan: allow creating vlan when real device is not up

PATCH In review Stephen Hemminger 3 participants 3 messages Jul 30, 2009 – Jul 31, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vlan: allow creating vlan when real device is not up

There is no reason for the arbitrary restriction that device must be up to create a vlan. This patch was added to Vyatta kernel to resolve startup ordering issues where vlan's are created but real device was disabled.

Note: the vlan already correctly inherits the operstate from real device; so if vlan is created and real device is marked down, the vlan is marked down.

net/8021q/vlan.c +0 -6
@@ -225,12 +225,6 @@ int vlan_check_real_dev(struct net_devic
 		return -EOPNOTSUPP;
 	}
 
-	/* The real device must be up and operating in order to
-	 * assosciate a VLAN device with it.
-	 */
-	if (!(real_dev->flags & IFF_UP))
-		return -ENETDOWN;
-
 	if (__find_vlan_dev(real_dev, vlan_id) != NULL)
 		return -EEXIST;
 
maintainer
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Thu, 30 Jul 2009 11:23:21 -0700

Quoted 9 lines

There is no reason for the arbitrary restriction that device must be up to create a vlan. This patch was added to Vyatta kernel to resolve startup ordering issues where vlan's are created but real device was disabled.

Note: the vlan already correctly inherits the operstate from real device; so if vlan is created and real device is marked down, the vlan is marked down.

Looks fine, added to net-next-2.6

We can revert if Patrick or someone else finds a potential problem with allowing this.

Thanks.

#2 lore raw
Quoted 11 lines · David Miller

From: Stephen Hemminger <[email protected]>
Date: Thu, 30 Jul 2009 11:23:21 -0700

Quoted 8 lines

There is no reason for the arbitrary restriction that device must be up to create a vlan. This patch was added to Vyatta kernel to resolve startup ordering issues where vlan's are created but real device was disabled.

Note: the vlan already correctly inherits the operstate from real device; so if vlan is created and real device is marked down, the vlan is marked down.

Quoted 6 lines
Quoted 1 line

Looks fine, added to net-next-2.6

We can revert if Patrick or someone else finds a potential problem with allowing this.

It seems perfectly fine to me, we can get to the same state by setting the lower device down after creating the VLAN device.