aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_if.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2012-12-28 13:15:22 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-30 05:31:43 -0500
commit576eb62598f10c8c7fd75703fe89010cdcfff596 (patch)
tree47317f7bc68dc06ad06735eb7c9ba4e271dcd793 /net/bridge/br_if.c
parentaa1113d9f85da59dcbdd32aeb5d71da566e46def (diff)
bridge: respect RFC2863 operational state
The bridge link detection should follow the operational state of the lower device, rather than the carrier bit. This allows devices like tunnels that are controlled by userspace control plane to work with bridge STP link management. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Reviewed-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r--net/bridge/br_if.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 37fe693471a8..1edd71d44a4c 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -66,14 +66,14 @@ void br_port_carrier_check(struct net_bridge_port *p)
66 struct net_device *dev = p->dev; 66 struct net_device *dev = p->dev;
67 struct net_bridge *br = p->br; 67 struct net_bridge *br = p->br;
68 68
69 if (netif_running(dev) && netif_carrier_ok(dev)) 69 if (netif_running(dev) && netif_oper_up(dev))
70 p->path_cost = port_cost(dev); 70 p->path_cost = port_cost(dev);
71 71
72 if (!netif_running(br->dev)) 72 if (!netif_running(br->dev))
73 return; 73 return;
74 74
75 spin_lock_bh(&br->lock); 75 spin_lock_bh(&br->lock);
76 if (netif_running(dev) && netif_carrier_ok(dev)) { 76 if (netif_running(dev) && netif_oper_up(dev)) {
77 if (p->state == BR_STATE_DISABLED) 77 if (p->state == BR_STATE_DISABLED)
78 br_stp_enable_port(p); 78 br_stp_enable_port(p);
79 } else { 79 } else {
@@ -383,7 +383,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
383 spin_lock_bh(&br->lock); 383 spin_lock_bh(&br->lock);
384 changed_addr = br_stp_recalculate_bridge_id(br); 384 changed_addr = br_stp_recalculate_bridge_id(br);
385 385
386 if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) && 386 if (netif_running(dev) && netif_oper_up(dev) &&
387 (br->dev->flags & IFF_UP)) 387 (br->dev->flags & IFF_UP))
388 br_stp_enable_port(p); 388 br_stp_enable_port(p);
389 spin_unlock_bh(&br->lock); 389 spin_unlock_bh(&br->lock);