All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joachim Wiberg <troglobit@gmail.com>
To: netdev@vger.kernel.org
Cc: David Ahern <dsahern@kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Joachim Wiberg <troglobit@gmail.com>
Subject: [PATCH iproute2-next v3 4/7] ip: iplink_bridge_slave: support for broadcast flooding
Date: Wed,  9 Mar 2022 20:23:13 +0100	[thread overview]
Message-ID: <20220309192316.2918792-5-troglobit@gmail.com> (raw)
In-Reply-To: <20220309192316.2918792-1-troglobit@gmail.com>

Add per-port support for controlling flooding of broadcast traffic.
Similar to unicast and multcast flooding that already exist.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
 ip/iplink_bridge_slave.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ip/iplink_bridge_slave.c b/ip/iplink_bridge_slave.c
index 71787586..0cf3422d 100644
--- a/ip/iplink_bridge_slave.c
+++ b/ip/iplink_bridge_slave.c
@@ -37,6 +37,7 @@ static void print_explain(FILE *f)
 		"			[ mcast_router MULTICAST_ROUTER ]\n"
 		"			[ mcast_fast_leave {on | off} ]\n"
 		"			[ mcast_flood {on | off} ]\n"
+		"			[ bcast_flood {on | off} ]\n"
 		"			[ mcast_to_unicast {on | off} ]\n"
 		"			[ group_fwd_mask MASK ]\n"
 		"			[ neigh_suppress {on | off} ]\n"
@@ -250,6 +251,10 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
 		print_on_off(PRINT_ANY, "mcast_flood", "mcast_flood %s ",
 			     rta_getattr_u8(tb[IFLA_BRPORT_MCAST_FLOOD]));
 
+	if (tb[IFLA_BRPORT_BCAST_FLOOD])
+		print_on_off(PRINT_ANY, "bcast_flood", "bcast_flood %s ",
+			     rta_getattr_u8(tb[IFLA_BRPORT_BCAST_FLOOD]));
+
 	if (tb[IFLA_BRPORT_MCAST_TO_UCAST])
 		print_on_off(PRINT_ANY, "mcast_to_unicast", "mcast_to_unicast %s ",
 			     rta_getattr_u8(tb[IFLA_BRPORT_MCAST_TO_UCAST]));
@@ -350,6 +355,10 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv,
 			NEXT_ARG();
 			bridge_slave_parse_on_off("mcast_flood", *argv, n,
 						  IFLA_BRPORT_MCAST_FLOOD);
+		} else if (matches(*argv, "bcast_flood") == 0) {
+			NEXT_ARG();
+			bridge_slave_parse_on_off("bcast_flood", *argv, n,
+						  IFLA_BRPORT_BCAST_FLOOD);
 		} else if (matches(*argv, "mcast_to_unicast") == 0) {
 			NEXT_ARG();
 			bridge_slave_parse_on_off("mcast_to_unicast", *argv, n,
-- 
2.25.1


  parent reply	other threads:[~2022-03-09 19:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 19:23 [PATCH iproute2-next v3 0/7] bridge: support for controlling broadcast flooding per port Joachim Wiberg
2022-03-09 19:23 ` [PATCH iproute2-next v3 1/7] bridge: support for controlling flooding of broadcast " Joachim Wiberg
2022-03-09 19:23 ` [PATCH iproute2-next v3 2/7] man: bridge: document new bcast_flood flag for bridge ports Joachim Wiberg
2022-03-09 19:23 ` [PATCH iproute2-next v3 3/7] man: bridge: add missing closing " in bridge show mdb Joachim Wiberg
2022-03-09 19:23 ` Joachim Wiberg [this message]
2022-03-09 19:23 ` [PATCH iproute2-next v3 5/7] man: ip-link: document new bcast_flood flag on bridge ports Joachim Wiberg
2022-03-09 19:23 ` [PATCH iproute2-next v3 6/7] man: ip-link: mention bridge port's default mcast_flood state Joachim Wiberg
2022-03-09 19:23 ` [PATCH iproute2-next v3 7/7] man: ip-link: whitespace fixes to odd line breaks mid sentence Joachim Wiberg
2022-03-10  9:01 ` [PATCH iproute2-next v3 0/7] bridge: support for controlling broadcast flooding per port Nikolay Aleksandrov
2022-03-12 16:10 ` patchwork-bot+netdevbpf

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=20220309192316.2918792-5-troglobit@gmail.com \
    --to=troglobit@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    --cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.