aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2013-04-30 01:29:27 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-30 15:51:08 -0400
commit91bc033c4d01656e3d8e45a13fd58924a3099693 (patch)
tree65a63f722f79435b3eb25deb62819ec3f903a354 /net/bridge
parent7dcf313a7a68adc9a060e4e41a55245c0f9a3d31 (diff)
bridge: avoid OOPS if root port not found
Bridge can crash while trying to send topology change packet. This happens if root port can't be found. This was reported by user but currently unable to reproduce it easily. The STP conditions that cause this are not known yet, but the problem doesn't have to be fatal. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_stp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index b01849a74310..1c0a50f13229 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -225,7 +225,14 @@ static void br_record_config_timeout_values(struct net_bridge *br,
225/* called under bridge lock */ 225/* called under bridge lock */
226void br_transmit_tcn(struct net_bridge *br) 226void br_transmit_tcn(struct net_bridge *br)
227{ 227{
228 br_send_tcn_bpdu(br_get_port(br, br->root_port)); 228 struct net_bridge_port *p;
229
230 p = br_get_port(br, br->root_port);
231 if (p)
232 br_send_tcn_bpdu(p);
233 else
234 br_notice(br, "root port %u not found for topology notice\n",
235 br->root_port);
229} 236}
230 237
231/* called under bridge lock */ 238/* called under bridge lock */