[PATCH] bridge: packets leaking out of disabled/blocked ports

STALE6941d

3 messages, 3 authors, 2007-08-31 · open the first message on its own page

[PATCH] bridge: packets leaking out of disabled/blocked ports

From: Stephen Hemminger <hidden>
Date: 2007-08-30 19:23:06

This patch fixes some packet leakage in bridge.  The bridging code
was allowing forward table entries to be generated even if a device
was being blocked. The fix is to not add forwarding database entries
unless the port is active.

The bug arose as part of the conversion to processing STP frames
through normal receive path (in 2.6.17).

Signed-off-by: Stephen Hemminger <redacted>
--- a/net/bridge/br_fdb.c	2007-08-30 07:49:01.000000000 -0700
+++ b/net/bridge/br_fdb.c	2007-08-30 11:40:36.000000000 -0700
@@ -384,6 +384,11 @@ void br_fdb_update(struct net_bridge *br
 	if (hold_time(br) == 0)
 		return;
 
+	/* ignore packets unless we are using this port */
+	if (!(source->state == BR_STATE_LEARNING ||
+	      source->state == BR_STATE_FORWARDING))
+		return;
+
 	fdb = fdb_find(head, addr);
 	if (likely(fdb)) {
 		/* attempt to update an entry for a local interface */
--- a/net/bridge/br_input.c	2007-08-30 07:49:01.000000000 -0700
+++ b/net/bridge/br_input.c	2007-08-30 12:19:57.000000000 -0700
@@ -101,9 +101,8 @@ static int br_handle_local_finish(struct
 {
 	struct net_bridge_port *p = rcu_dereference(skb->dev->br_port);
 
-	if (p && p->state != BR_STATE_DISABLED)
+	if (p)
 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
-
 	return 0;	 /* process further */
 }
 

Re: [PATCH] bridge: packets leaking out of disabled/blocked ports

From: John W. Linville <hidden>
Date: 2007-08-30 20:44:49

On Thu, Aug 30, 2007 at 12:22:58PM -0700, Stephen Hemminger wrote:
This patch fixes some packet leakage in bridge.  The bridging code
was allowing forward table entries to be generated even if a device
was being blocked. The fix is to not add forwarding database entries
unless the port is active.
Seems reasonable -- ACK

John
-- 
John W. Linville
linville@tuxdriver.com

Re: [PATCH] bridge: packets leaking out of disabled/blocked ports

From: David Miller <davem@davemloft.net>
Date: 2007-08-31 05:15:46

From: "John W. Linville" <redacted>
Date: Thu, 30 Aug 2007 16:03:13 -0400
On Thu, Aug 30, 2007 at 12:22:58PM -0700, Stephen Hemminger wrote:
quoted
This patch fixes some packet leakage in bridge.  The bridging code
was allowing forward table entries to be generated even if a device
was being blocked. The fix is to not add forwarding database entries
unless the port is active.
Seems reasonable -- ACK
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help