diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-03-21 17:22:44 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:48 -0400 |
commit | 9cde070874b822d4677f4f01fe146991785813b1 (patch) | |
tree | 2e3a444ad82e026237ce99a4f8cad201f6ca807d /net/bridge/br_stp.c | |
parent | 9cf637473c8535b5abe27fee79254c2d552e042a (diff) |
bridge: add support for user mode STP
This patchset based on work by Aji_Srinivas@emc.com provides allows
spanning tree to be controled from userspace. Like hotplug, it
uses call_usermodehelper when spanning tree is enabled so there
is no visible API change. If call to start usermode STP fails
it falls back to existing kernel STP.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Diffstat (limited to 'net/bridge/br_stp.c')
-rw-r--r-- | net/bridge/br_stp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index f9ff4d57b0d7..ebb0861e9bd5 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c | |||
@@ -370,11 +370,11 @@ static void br_make_blocking(struct net_bridge_port *p) | |||
370 | static void br_make_forwarding(struct net_bridge_port *p) | 370 | static void br_make_forwarding(struct net_bridge_port *p) |
371 | { | 371 | { |
372 | if (p->state == BR_STATE_BLOCKING) { | 372 | if (p->state == BR_STATE_BLOCKING) { |
373 | if (p->br->stp_enabled) { | 373 | if (p->br->stp_enabled == BR_KERNEL_STP) |
374 | p->state = BR_STATE_LISTENING; | 374 | p->state = BR_STATE_LISTENING; |
375 | } else { | 375 | else |
376 | p->state = BR_STATE_LEARNING; | 376 | p->state = BR_STATE_LEARNING; |
377 | } | 377 | |
378 | br_log_state(p); | 378 | br_log_state(p); |
379 | mod_timer(&p->forward_delay_timer, jiffies + p->br->forward_delay); } | 379 | mod_timer(&p->forward_delay_timer, jiffies + p->br->forward_delay); } |
380 | } | 380 | } |
@@ -384,6 +384,10 @@ void br_port_state_selection(struct net_bridge *br) | |||
384 | { | 384 | { |
385 | struct net_bridge_port *p; | 385 | struct net_bridge_port *p; |
386 | 386 | ||
387 | /* Don't change port states if userspace is handling STP */ | ||
388 | if (br->stp_enabled == BR_USER_STP) | ||
389 | return; | ||
390 | |||
387 | list_for_each_entry(p, &br->port_list, list) { | 391 | list_for_each_entry(p, &br->port_list, list) { |
388 | if (p->state != BR_STATE_DISABLED) { | 392 | if (p->state != BR_STATE_DISABLED) { |
389 | if (p->port_no == br->root_port) { | 393 | if (p->port_no == br->root_port) { |