aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-01 23:09:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-01 23:09:08 -0500
commit5983fe2b29df5885880d7fa3b91aca306c7564ef (patch)
treec9d968a776b7d1f8dc446d2857f6cefddec6edb0 /net/bridge
parent5611cc4572e889b62a7b4c72a413536bf6a9c416 (diff)
parent3ced1be5490f5c415d51a1e5918beeb9239d546b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (73 commits) netfilter: Remove ADVANCED dependency from NF_CONNTRACK_NETBIOS_NS ipv4: flush route cache after change accept_local sch_red: fix red_change Revert "udp: remove redundant variable" bridge: master device stuck in no-carrier state forever when in user-stp mode ipv4: Perform peer validation on cached route lookup. net/core: fix rollback handler in register_netdevice_notifier sch_red: fix red_calc_qavg_from_idle_time bonding: only use primary address for ARP ipv4: fix lockdep splat in rt_cache_seq_show sch_teql: fix lockdep splat net: fec: Select the FEC driver by default for i.MX SoCs isdn: avoid copying too long drvid isdn: make sure strings are null terminated netlabel: Fix build problems when IPv6 is not enabled sctp: better integer overflow check in sctp_auth_create_key() sctp: integer overflow in sctp_auth_create_key() ipv6: Set mcast_hops to IPV6_DEFAULT_MCASTHOPS when -1 was given. net: Fix corruption in /proc/*/net/dev_mcast mac80211: fix race between the AGG SM and the Tx data path ...
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netlink.c6
-rw-r--r--net/bridge/br_stp.c29
2 files changed, 20 insertions, 15 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index e5f9ece3c9a..a1daf8227ed 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -18,6 +18,7 @@
18#include <net/sock.h> 18#include <net/sock.h>
19 19
20#include "br_private.h" 20#include "br_private.h"
21#include "br_private_stp.h"
21 22
22static inline size_t br_nlmsg_size(void) 23static inline size_t br_nlmsg_size(void)
23{ 24{
@@ -188,6 +189,11 @@ static int br_rtm_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
188 189
189 p->state = new_state; 190 p->state = new_state;
190 br_log_state(p); 191 br_log_state(p);
192
193 spin_lock_bh(&p->br->lock);
194 br_port_state_selection(p->br);
195 spin_unlock_bh(&p->br->lock);
196
191 br_ifinfo_notify(RTM_NEWLINK, p); 197 br_ifinfo_notify(RTM_NEWLINK, p);
192 198
193 return 0; 199 return 0;
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index ad0a3f7cf6c..dd147d78a58 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -399,25 +399,24 @@ void br_port_state_selection(struct net_bridge *br)
399 struct net_bridge_port *p; 399 struct net_bridge_port *p;
400 unsigned int liveports = 0; 400 unsigned int liveports = 0;
401 401
402 /* Don't change port states if userspace is handling STP */
403 if (br->stp_enabled == BR_USER_STP)
404 return;
405
406 list_for_each_entry(p, &br->port_list, list) { 402 list_for_each_entry(p, &br->port_list, list) {
407 if (p->state == BR_STATE_DISABLED) 403 if (p->state == BR_STATE_DISABLED)
408 continue; 404 continue;
409 405
410 if (p->port_no == br->root_port) { 406 /* Don't change port states if userspace is handling STP */
411 p->config_pending = 0; 407 if (br->stp_enabled != BR_USER_STP) {
412 p->topology_change_ack = 0; 408 if (p->port_no == br->root_port) {
413 br_make_forwarding(p); 409 p->config_pending = 0;
414 } else if (br_is_designated_port(p)) { 410 p->topology_change_ack = 0;
415 del_timer(&p->message_age_timer); 411 br_make_forwarding(p);
416 br_make_forwarding(p); 412 } else if (br_is_designated_port(p)) {
417 } else { 413 del_timer(&p->message_age_timer);
418 p->config_pending = 0; 414 br_make_forwarding(p);
419 p->topology_change_ack = 0; 415 } else {
420 br_make_blocking(p); 416 p->config_pending = 0;
417 p->topology_change_ack = 0;
418 br_make_blocking(p);
419 }
421 } 420 }
422 421
423 if (p->state == BR_STATE_FORWARDING) 422 if (p->state == BR_STATE_FORWARDING)