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>
This commit is contained in:
stephen hemminger 2010-08-24 13:12:56 +00:00 committed by David S. Miller
parent c5dadddb8c
commit aa7c6e5fa0

View File

@ -67,20 +67,21 @@ void br_port_carrier_check(struct net_bridge_port *p)
struct net_device *dev = p->dev; struct net_device *dev = p->dev;
struct net_bridge *br = p->br; 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); p->path_cost = port_cost(dev);
if (netif_running(br->dev)) { if (!netif_running(br->dev))
spin_lock_bh(&br->lock); return;
if (netif_carrier_ok(dev)) {
if (p->state == BR_STATE_DISABLED) spin_lock_bh(&br->lock);
br_stp_enable_port(p); if (netif_running(dev) && netif_carrier_ok(dev)) {
} else { if (p->state == BR_STATE_DISABLED)
if (p->state != BR_STATE_DISABLED) br_stp_enable_port(p);
br_stp_disable_port(p); } else {
} if (p->state != BR_STATE_DISABLED)
spin_unlock_bh(&br->lock); br_stp_disable_port(p);
} }
spin_unlock_bh(&br->lock);
} }
static void release_nbp(struct kobject *kobj) static void release_nbp(struct kobject *kobj)