From 8cb947c8168fdbe1d63fbf9dc6945ce8f17eb6d3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 28 Feb 2017 16:12:00 +0100 Subject: [PATCH] iplink: bridge: add support for IFLA_BR_MCAST_ROUTER Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289 Upstream Status: iproute2.git commit 963d137cf927c commit 963d137cf927c4d323cf77fb30c3695feff5367b Author: Nikolay Aleksandrov Date: Tue Feb 9 00:14:25 2016 +0100 iplink: bridge: add support for IFLA_BR_MCAST_ROUTER This patch implements support for the IFLA_BR_MCAST_ROUTER attribute in iproute2 so it can change the multicast router value. Signed-off-by: Nikolay Aleksandrov --- ip/iplink_bridge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c index da3a063..7c2165c 100644 --- a/ip/iplink_bridge.c +++ b/ip/iplink_bridge.c @@ -33,6 +33,7 @@ static void print_explain(FILE *f) " [ vlan_filtering VLAN_FILTERING ]\n" " [ vlan_protocol VLAN_PROTOCOL ]\n" " [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n" + " [ mcast_router MULTICAST_ROUTER ]\n" "\n" "Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n" ); @@ -146,6 +147,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, addattr16(n, 1024, IFLA_BR_VLAN_DEFAULT_PVID, default_pvid); + } else if (matches(*argv, "mcast_router") == 0) { + __u8 mcast_router; + + NEXT_ARG(); + if (get_u8(&mcast_router, *argv, 0)) + invarg("invalid mcast_router", *argv); + + addattr8(n, 1024, IFLA_BR_MCAST_ROUTER, mcast_router); } else if (matches(*argv, "help") == 0) { explain(); return -1; @@ -283,6 +292,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) RTA_PAYLOAD(tb[IFLA_BR_GROUP_ADDR]), 1 /*ARPHDR_ETHER*/, mac, sizeof(mac))); } + + if (tb[IFLA_BR_MCAST_ROUTER]) + fprintf(f, "mcast_router %u ", + rta_getattr_u8(tb[IFLA_BR_MCAST_ROUTER])); } static void bridge_print_help(struct link_util *lu, int argc, char **argv, -- 1.8.3.1