From: Lin Ming <minggr@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org
Subject: [PATCH] bridge: don't flood multicast packets if no snooping entry
Date: Fri, 12 Oct 2012 09:17:23 +0800 [thread overview]
Message-ID: <1350004643-3786-1-git-send-email-minggr@gmail.com> (raw)
From: Lin Ming <mlin@ss.pku.edu.cn>
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 <mlin@ss.pku.edu.cn>
---
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
next reply other threads:[~2012-10-12 1:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-12 1:17 Lin Ming [this message]
2012-10-12 1:48 ` [PATCH] bridge: don't flood multicast packets if no snooping entry Herbert Xu
2012-10-12 2:14 ` Lin Ming
2012-10-12 2:27 ` Herbert Xu
2012-10-12 5:19 ` Lin Ming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350004643-3786-1-git-send-email-minggr@gmail.com \
--to=minggr@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox