Commit 91bc033c authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

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: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7dcf313a
...@@ -225,7 +225,14 @@ static void br_record_config_timeout_values(struct net_bridge *br, ...@@ -225,7 +225,14 @@ static void br_record_config_timeout_values(struct net_bridge *br,
/* called under bridge lock */ /* called under bridge lock */
void br_transmit_tcn(struct net_bridge *br) void br_transmit_tcn(struct net_bridge *br)
{ {
br_send_tcn_bpdu(br_get_port(br, br->root_port)); struct net_bridge_port *p;
p = br_get_port(br, br->root_port);
if (p)
br_send_tcn_bpdu(p);
else
br_notice(br, "root port %u not found for topology notice\n",
br->root_port);
} }
/* called under bridge lock */ /* called under bridge lock */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment