aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_netlink.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_netlink.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_netlink.c')
-rw-r--r--net/bridge/br_netlink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 97ba0189c6f7..caa3f6919436 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -181,8 +181,11 @@ static int br_set_port_state(struct net_bridge_port *p, u8 state)
181 if (p->br->stp_enabled == BR_KERNEL_STP) 181 if (p->br->stp_enabled == BR_KERNEL_STP)
182 return -EBUSY; 182 return -EBUSY;
183 183
184 /* if device is not up, change is not allowed
185 * if link is not present, only allowable state is disabled
186 */
184 if (!netif_running(p->dev) || 187 if (!netif_running(p->dev) ||
185 (!netif_carrier_ok(p->dev) && state != BR_STATE_DISABLED)) 188 (!netif_oper_up(p->dev) && state != BR_STATE_DISABLED))
186 return -ENETDOWN; 189 return -ENETDOWN;
187 190
188 p->state = state; 191 p->state = state;