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

Submitted by Petri Gynther on Aug. 26, 2009, 8:35 p.m.

Details

Message ID 20090826203500.9E54B254211@localhost
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Petri Gynther Aug. 26, 2009, 8:35 p.m.
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".

Signed-off-by: Petri Gynther <pgynther@google.com>
---
 drivers/net/bonding/bond_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index aa1be1f..0835cbe 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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;