Skip to contentSkip to conversation

: Fix thinko in macvlan_transfer_operstate()

MACVLAN Applied Patrick McHardy 2 participants 2 messages Jan 20, 2008 – Jan 21, 2008

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

Fix a minor thinko in macvlan. The bug is uncritical, so this doesn't need to go in 2.6.24.

commit b40b16bb72ae1ad192daef55a3e9f81d76cd97ab

Author: Patrick McHardy <[email protected]>
Date:   Thu Jan 17 09:18:11 2008 +0100

[MACVLAN]: Fix thinko in macvlan_transfer_operstate()

When the lower device's carrier is off, the macvlan devices's carrier state should be checked to decide whether it needs to be turned off. Currently the lower device's state is checked a second time.

This still works, but unnecessarily tries to turn off the carrier when its already off.

drivers/net/macvlan.c +1 -1
index 3acf8cd..312526b 100644
@@ -375,7 +375,7 @@ static void macvlan_transfer_operstate(struct net_device *dev)
 		if (!netif_carrier_ok(dev))
 			netif_carrier_on(dev);
 	} else {
-		if (netif_carrier_ok(lowerdev))
+		if (netif_carrier_ok(dev))
 			netif_carrier_off(dev);
 	}
 }
maintainer Applied
#1 lore raw

From: Patrick McHardy <[email protected]>
Date: Sun, 20 Jan 2008 15:47:08 +0100

Quoted 11 lines

[MACVLAN]: Fix thinko in macvlan_transfer_operstate()

When the lower device's carrier is off, the macvlan devices's carrier state should be checked to decide whether it needs to be turned off. Currently the lower device's state is checked a second time.

This still works, but unnecessarily tries to turn off the carrier when its already off.

Applied to net-2.6.25, thanks.