Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276267
b: refs/heads/master
c: b03b6dd
h: refs/heads/master
i:
  276265: 4be82ad
  276263: 08d5bb3
v: v3
  • Loading branch information
Vitalii Demianets authored and David S. Miller committed Dec 1, 2011
1 parent c0fa956 commit 7c6dbf1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: efbc368dcc6426d5430b9b8eeda944cf2cb74b8c
refs/heads/master: b03b6dd58cef7d15b7c46a6729b83dd535ef08ab
6 changes: 6 additions & 0 deletions trunk/net/bridge/br_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <net/sock.h>

#include "br_private.h"
#include "br_private_stp.h"

static inline size_t br_nlmsg_size(void)
{
Expand Down Expand Up @@ -188,6 +189,11 @@ static int br_rtm_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)

p->state = new_state;
br_log_state(p);

spin_lock_bh(&p->br->lock);
br_port_state_selection(p->br);
spin_unlock_bh(&p->br->lock);

br_ifinfo_notify(RTM_NEWLINK, p);

return 0;
Expand Down
29 changes: 14 additions & 15 deletions trunk/net/bridge/br_stp.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,25 +399,24 @@ void br_port_state_selection(struct net_bridge *br)
struct net_bridge_port *p;
unsigned int liveports = 0;

/* Don't change port states if userspace is handling STP */
if (br->stp_enabled == BR_USER_STP)
return;

list_for_each_entry(p, &br->port_list, list) {
if (p->state == BR_STATE_DISABLED)
continue;

if (p->port_no == br->root_port) {
p->config_pending = 0;
p->topology_change_ack = 0;
br_make_forwarding(p);
} else if (br_is_designated_port(p)) {
del_timer(&p->message_age_timer);
br_make_forwarding(p);
} else {
p->config_pending = 0;
p->topology_change_ack = 0;
br_make_blocking(p);
/* Don't change port states if userspace is handling STP */
if (br->stp_enabled != BR_USER_STP) {
if (p->port_no == br->root_port) {
p->config_pending = 0;
p->topology_change_ack = 0;
br_make_forwarding(p);
} else if (br_is_designated_port(p)) {
del_timer(&p->message_age_timer);
br_make_forwarding(p);
} else {
p->config_pending = 0;
p->topology_change_ack = 0;
br_make_blocking(p);
}
}

if (p->state == BR_STATE_FORWARDING)
Expand Down

0 comments on commit 7c6dbf1

Please sign in to comment.