Thread (5 messages) 5 messages, 2 authors, 2012-10-12

[PATCH] bridge: don't flood multicast packets if no snooping entry

flat view
STALE5119d

From: Lin Ming <hidden>
Date: 2012-10-12 01:18:39
Subsystem: ethernet bridge, networking [general], the rest · Maintainers: Nikolay Aleksandrov, Ido Schimmel, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Lin Ming <redacted>

Currently, multicast packets will be flood even if there is no
mutlicast snooping entry attached to port.

With IGMP snooping enabled, we should stop sending multicast packets
if there is no member joined.

Signed-off-by: Lin Ming <redacted>
---
 net/bridge/br_input.c   |    2 ++
 net/bridge/br_private.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 76f15fd..2821085 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -90,6 +90,8 @@ int br_handle_frame_finish(struct sk_buff *skb)
 			skb = NULL;
 			if (!skb2)
 				goto out;
+		} else if (!mdst && BR_INPUT_SKB_CB_NOT_IGMP(skb)) {
+			skb = NULL;
 		} else
 			skb2 = skb;
 
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 9b278c4..e2c894d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -268,8 +268,10 @@ struct br_input_skb_cb {
 
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 # define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb)	(BR_INPUT_SKB_CB(__skb)->mrouters_only)
+# define BR_INPUT_SKB_CB_NOT_IGMP(__skb)	(!BR_INPUT_SKB_CB(__skb)->igmp)
 #else
 # define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb)	(0)
+# define BR_INPUT_SKB_CB_NOT_IGMP(__skb)	(0)
 #endif
 
 #define br_printk(level, br, format, args...)	\
-- 
1.7.2.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help