diff options
Diffstat (limited to 'net/bridge/br_stp.c')
-rw-r--r-- | net/bridge/br_stp.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index af9a12099ba4..b01849a74310 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c | |||
@@ -100,6 +100,21 @@ static int br_should_become_root_port(const struct net_bridge_port *p, | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | static void br_root_port_block(const struct net_bridge *br, | ||
104 | struct net_bridge_port *p) | ||
105 | { | ||
106 | |||
107 | br_notice(br, "port %u(%s) tried to become root port (blocked)", | ||
108 | (unsigned int) p->port_no, p->dev->name); | ||
109 | |||
110 | p->state = BR_STATE_LISTENING; | ||
111 | br_log_state(p); | ||
112 | br_ifinfo_notify(RTM_NEWLINK, p); | ||
113 | |||
114 | if (br->forward_delay > 0) | ||
115 | mod_timer(&p->forward_delay_timer, jiffies + br->forward_delay); | ||
116 | } | ||
117 | |||
103 | /* called under bridge lock */ | 118 | /* called under bridge lock */ |
104 | static void br_root_selection(struct net_bridge *br) | 119 | static void br_root_selection(struct net_bridge *br) |
105 | { | 120 | { |
@@ -107,7 +122,12 @@ static void br_root_selection(struct net_bridge *br) | |||
107 | u16 root_port = 0; | 122 | u16 root_port = 0; |
108 | 123 | ||
109 | list_for_each_entry(p, &br->port_list, list) { | 124 | list_for_each_entry(p, &br->port_list, list) { |
110 | if (br_should_become_root_port(p, root_port)) | 125 | if (!br_should_become_root_port(p, root_port)) |
126 | continue; | ||
127 | |||
128 | if (p->flags & BR_ROOT_BLOCK) | ||
129 | br_root_port_block(br, p); | ||
130 | else | ||
111 | root_port = p->port_no; | 131 | root_port = p->port_no; |
112 | } | 132 | } |
113 | 133 | ||