Skip to contentSkip to conversation

bonding: bond_check_dev_link() needs to check for netif_running()

PATCH New Petri Gynther 1 participant 1 message Aug 26, 2009

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

PATCH 1/1 bonding: bond_check_dev_link() needs to check for netif_running()

bond_check_dev_link() needs to check for netif_running() before checking the link status of a slave. This needs to be done because some interfaces keep reporting netif_carrier_ok() == TRUE even after "ifconfig down".

---
 drivers/net/bonding/bond_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/bonding/bond_main.c +3 -0
index aa1be1f..0835cbe 100644
@@ -695,6 +695,9 @@ static int bond_check_dev_link(struct bonding *bond,
 	struct ifreq ifr;
 	struct mii_ioctl_data *mii;
 
+	if (!netif_running(slave_dev))
+		return 0;
+
 	if (bond->params.use_carrier)
 		return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
 
Signature · 1 line
1.5.4.3