diff options
author | Joachim Wiberg <troglobit@gmail.com> | 2022-03-16 10:02:56 +0100 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2022-03-20 17:36:05 -0600 |
commit | 9e82e828764aa1c0303697164883fc355e9310b8 (patch) | |
tree | 4e5d21100810be82ef163832cfcd48ba809a1a39 | |
parent | f1d18e2e6ec5680fe1926de0da9bed428f2e0475 (diff) | |
download | iproute2-9e82e828764aa1c0303697164883fc355e9310b8.tar.gz |
bridge: support for controlling mcast_router per port
The bridge vlan command supports setting mcast_router per-port and
per-vlan, what's however missing is the ability to set the per-port
mcast_router options, e.g. when VLAN filtering is disabled.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
-rw-r--r-- | bridge/link.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bridge/link.c b/bridge/link.c index 80b01f563..3810fa045 100644 --- a/bridge/link.c +++ b/bridge/link.c @@ -156,6 +156,9 @@ static void print_protinfo(FILE *fp, struct rtattr *attr) if (prtb[IFLA_BRPORT_BCAST_FLOOD]) print_on_off(PRINT_ANY, "bcast_flood", "bcast_flood %s ", rta_getattr_u8(prtb[IFLA_BRPORT_BCAST_FLOOD])); + if (prtb[IFLA_BRPORT_MULTICAST_ROUTER]) + print_uint(PRINT_ANY, "mcast_router", "mcast_router %u ", + rta_getattr_u8(prtb[IFLA_BRPORT_MULTICAST_ROUTER])); if (prtb[IFLA_BRPORT_MCAST_TO_UCAST]) print_on_off(PRINT_ANY, "mcast_to_unicast", "mcast_to_unicast %s ", rta_getattr_u8(prtb[IFLA_BRPORT_MCAST_TO_UCAST])); @@ -270,6 +273,7 @@ static void usage(void) " [ learning {on | off} ]\n" " [ learning_sync {on | off} ]\n" " [ flood {on | off} ]\n" + " [ mcast_router MULTICAST_ROUTER ]\n" " [ mcast_flood {on | off} ]\n" " [ bcast_flood {on | off} ]\n" " [ mcast_to_unicast {on | off} ]\n" @@ -303,6 +307,7 @@ static int brlink_modify(int argc, char **argv) __s8 learning_sync = -1; __s8 flood = -1; __s8 vlan_tunnel = -1; + __s8 mcast_router = -1; __s8 mcast_flood = -1; __s8 bcast_flood = -1; __s8 mcast_to_unicast = -1; @@ -359,6 +364,9 @@ static int brlink_modify(int argc, char **argv) flood = parse_on_off("flood", *argv, &ret); if (ret) return ret; + } else if (strcmp(*argv, "mcast_router") == 0) { + NEXT_ARG(); + mcast_router = atoi(*argv); } else if (strcmp(*argv, "mcast_flood") == 0) { NEXT_ARG(); mcast_flood = parse_on_off("mcast_flood", *argv, &ret); @@ -473,6 +481,9 @@ static int brlink_modify(int argc, char **argv) addattr8(&req.n, sizeof(req), IFLA_BRPORT_PROTECT, root_block); if (flood >= 0) addattr8(&req.n, sizeof(req), IFLA_BRPORT_UNICAST_FLOOD, flood); + if (mcast_router >= 0) + addattr8(&req.n, sizeof(req), IFLA_BRPORT_MULTICAST_ROUTER, + mcast_router); if (mcast_flood >= 0) addattr8(&req.n, sizeof(req), IFLA_BRPORT_MCAST_FLOOD, mcast_flood); |