aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-08-24 09:12:56 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-25 19:36:51 -0400
commitaa7c6e5fa08bb5014b6432a690d28748f11e93fc (patch)
tree71849c8ddde749739a878dd5e10446e9a3ee06ae /net/bridge
parentc5dadddb8c9d310bc263f671f19fe3ba90b329fe (diff)
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.c23
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)
67 struct net_device *dev = p->dev; 67 struct net_device *dev = p->dev;
68 struct net_bridge *br = p->br; 68 struct net_bridge *br = p->br;
69 69
70 if (netif_carrier_ok(dev)) 70 if (netif_running(dev) && netif_carrier_ok(dev))
71 p->path_cost = port_cost(dev); 71 p->path_cost = port_cost(dev);
72 72
73 if (netif_running(br->dev)) { 73 if (!netif_running(br->dev))
74 spin_lock_bh(&br->lock); 74 return;
75 if (netif_carrier_ok(dev)) { 75
76 if (p->state == BR_STATE_DISABLED) 76 spin_lock_bh(&br->lock);
77 br_stp_enable_port(p); 77 if (netif_running(dev) && netif_carrier_ok(dev)) {
78 } else { 78 if (p->state == BR_STATE_DISABLED)
79 if (p->state != BR_STATE_DISABLED) 79 br_stp_enable_port(p);
80 br_stp_disable_port(p); 80 } else {
81 } 81 if (p->state != BR_STATE_DISABLED)
82 spin_unlock_bh(&br->lock); 82 br_stp_disable_port(p);
83 } 83 }
84 spin_unlock_bh(&br->lock);
84} 85}
85 86
86static void release_nbp(struct kobject *kobj) 87static void release_nbp(struct kobject *kobj)