netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] bridge: avoid OOPS if root port not found
@ 2013-04-30 15:29 Stephen Hemminger
  2013-04-30 19:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2013-04-30 15:29 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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>


--- a/net/bridge/br_stp.c	2013-03-07 18:12:53.885287247 -0800
+++ b/net/bridge/br_stp.c	2013-04-30 08:24:05.935771645 -0700
@@ -225,7 +225,14 @@ static void br_record_config_timeout_val
 /* called under bridge lock */
 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 */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net] bridge: avoid OOPS if root port not found
  2013-04-30 15:29 [PATCH net] bridge: avoid OOPS if root port not found Stephen Hemminger
@ 2013-04-30 19:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-04-30 19:52 UTC (permalink / raw)
  To: stephen; +Cc: netdev

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 30 Apr 2013 08:29:27 -0700

> 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>

Right, there's no reason we should flat-out crash because of this.

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-30 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-30 15:29 [PATCH net] bridge: avoid OOPS if root port not found Stephen Hemminger
2013-04-30 19:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).