diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-08-24 15:12:56 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-26 01:36:51 +0200 |
commit | aa7c6e5fa08bb5014b6432a690d28748f11e93fc (patch) | |
tree | 71849c8ddde749739a878dd5e10446e9a3ee06ae /net/bridge | |
parent | qlge: Fix a deadlock when the interface is going down (diff) | |
download | linux-aa7c6e5fa08bb5014b6432a690d28748f11e93fc.tar.xz linux-aa7c6e5fa08bb5014b6432a690d28748f11e93fc.zip |
bridge: avoid ethtool on non running interface
If bridge port is offline, don't call ethtool to query speed.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_if.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 170794546522..89ad25a76202 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -67,20 +67,21 @@ void br_port_carrier_check(struct net_bridge_port *p) struct net_device *dev = p->dev; struct net_bridge *br = p->br; - if (netif_carrier_ok(dev)) + if (netif_running(dev) && netif_carrier_ok(dev)) p->path_cost = port_cost(dev); - if (netif_running(br->dev)) { - spin_lock_bh(&br->lock); - if (netif_carrier_ok(dev)) { - if (p->state == BR_STATE_DISABLED) - br_stp_enable_port(p); - } else { - if (p->state != BR_STATE_DISABLED) - br_stp_disable_port(p); - } - spin_unlock_bh(&br->lock); + if (!netif_running(br->dev)) + return; + + spin_lock_bh(&br->lock); + if (netif_running(dev) && netif_carrier_ok(dev)) { + if (p->state == BR_STATE_DISABLED) + br_stp_enable_port(p); + } else { + if (p->state != BR_STATE_DISABLED) + br_stp_disable_port(p); } + spin_unlock_bh(&br->lock); } static void release_nbp(struct kobject *kobj) |