Skip to contentSkip to conversation

vlan: Match underlying dev carrier on vlan add

PATCH Applied Phil Oester 2 participants 2 messages Aug 18, 2010 – Aug 19, 2010

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

PATCH 1/1 vlan: Match underlying dev carrier on vlan add

When adding a new vlan, if the underlying interface has no carrier, then the newly added vlan interface should also have no carrier. At present, this is not true - the newly added vlan is added with carrier up. Fix by checking state of real device.

net/8021q/vlan_dev.c +2 -1
index 3d59c9b..3bccdd1 100644
@@ -510,7 +510,8 @@ static int vlan_dev_open(struct net_device *dev)
 	if (vlan->flags & VLAN_FLAG_GVRP)
 		vlan_gvrp_request_join(dev);
 
-	netif_carrier_on(dev);
+	if (netif_carrier_ok(real_dev))
+		netif_carrier_on(dev);
 	return 0;
 
 clear_allmulti:
maintainer Applied
#1 lore raw

From: Phil Oester <[email protected]>
Date: Tue, 17 Aug 2010 21:45:08 -0700

Quoted 6 lines

When adding a new vlan, if the underlying interface has no carrier, then the newly added vlan interface should also have no carrier. At present, this is not true - the newly added vlan is added with carrier up. Fix by checking state of real device.

Applied, thanks Phil.