From: Mike Manning <mmanning@brocade.com>
To: <netdev@vger.kernel.org>
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Subject: [PATCH] net: bridge: suppress broadcast when multicast flood is disabled
Date: Mon, 24 Apr 2017 15:09:04 +0100 [thread overview]
Message-ID: <1493042944-4005-1-git-send-email-mmanning@brocade.com> (raw)
Flood suppression for packets that are not unicast needs to be handled
consistently by also not flooding broadcast packets. As broadcast is a
special case of multicast, the same kernel parameter should be used to
suppress flooding for both of these packet types.
Fixes: b6cb5ac8331b ("net: bridge: add per-port multicast flood flag")
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Mike Manning <mmanning@brocade.com>
---
net/bridge/br_forward.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 902af6b..a61c7ad 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -183,13 +183,16 @@ void br_flood(struct net_bridge *br, struct sk_buff *skb,
struct net_bridge_port *p;
list_for_each_entry_rcu(p, &br->port_list, list) {
- /* Do not flood unicast traffic to ports that turn it off */
- if (pkt_type == BR_PKT_UNICAST && !(p->flags & BR_FLOOD))
- continue;
- /* Do not flood if mc off, except for traffic we originate */
- if (pkt_type == BR_PKT_MULTICAST &&
- !(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
- continue;
+ /* Do not flood unicast traffic to ports that turn it off, nor
+ * other traffic if mc flood off except for traffic we originate
+ */
+ if (pkt_type == BR_PKT_UNICAST) {
+ if (!(p->flags & BR_FLOOD))
+ continue;
+ } else {
+ if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
+ continue;
+ }
/* Do not flood to ports that enable proxy ARP */
if (p->flags & BR_PROXYARP)
--
2.1.4
next reply other threads:[~2017-04-24 14:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 14:09 Mike Manning [this message]
2017-04-24 19:00 ` [PATCH] net: bridge: suppress broadcast when multicast flood is disabled Stephen Hemminger
2017-04-24 19:52 ` Nikolay Aleksandrov
2017-04-25 13:32 ` Mike Manning
2017-04-25 14:03 ` Nikolay Aleksandrov
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=1493042944-4005-1-git-send-email-mmanning@brocade.com \
--to=mmanning@brocade.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
/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