]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: iplink_bridge_slave: support for broadcast flooding
authorJoachim Wiberg <troglobit@gmail.com>
Wed, 9 Mar 2022 19:23:13 +0000 (20:23 +0100)
committerDavid Ahern <dsahern@kernel.org>
Sat, 12 Mar 2022 15:57:37 +0000 (08:57 -0700)
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>
ip/iplink_bridge_slave.c

index da14a95eb4ed0c968eeacf6963ce4e87ca468bcb..98d1721348473c61ae38379c5b0942ec43b909ab 100644 (file)
@@ -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,