提交 aa7c6e5f 编写于 作者: S stephen hemminger 提交者: David S. Miller

bridge: avoid ethtool on non running interface

If bridge port is offline, don't call ethtool to query speed.
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c5dadddb
无相关合并请求
...@@ -67,12 +67,14 @@ void br_port_carrier_check(struct net_bridge_port *p) ...@@ -67,12 +67,14 @@ 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))
return;
spin_lock_bh(&br->lock); spin_lock_bh(&br->lock);
if (netif_carrier_ok(dev)) { if (netif_running(dev) && netif_carrier_ok(dev)) {
if (p->state == BR_STATE_DISABLED) if (p->state == BR_STATE_DISABLED)
br_stp_enable_port(p); br_stp_enable_port(p);
} else { } else {
...@@ -80,7 +82,6 @@ void br_port_carrier_check(struct net_bridge_port *p) ...@@ -80,7 +82,6 @@ void br_port_carrier_check(struct net_bridge_port *p)
br_stp_disable_port(p); br_stp_disable_port(p);
} }
spin_unlock_bh(&br->lock); spin_unlock_bh(&br->lock);
}
} }
static void release_nbp(struct kobject *kobj) static void release_nbp(struct kobject *kobj)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部