aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Wiberg <troglobit@gmail.com>2022-03-09 20:23:13 +0100
committerDavid Ahern <dsahern@kernel.org>2022-03-12 08:57:37 -0700
commitc354a434b1bfad1477a5ee0f45f9d7ceb33c1586 (patch)
treeb56ed645c8c327fde0b8ebf4ea759ace89fb6268
parent909f0d510153e16824302884200037ce5cfb9691 (diff)
downloadiproute2-c354a434b1bfad1477a5ee0f45f9d7ceb33c1586.tar.gz
ip: iplink_bridge_slave: support for broadcast flooding
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> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r--ip/iplink_bridge_slave.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ip/iplink_bridge_slave.c b/ip/iplink_bridge_slave.c
index da14a95eb..98d172134 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"
@@ -251,6 +252,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]));
@@ -355,6 +360,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,