|
|
4aca6e |
From 8769aa87b7b1def755ce8f7c1865815b038580c9 Mon Sep 17 00:00:00 2001
|
|
|
4aca6e |
From: Phil Sutter <psutter@redhat.com>
|
|
|
4aca6e |
Date: Tue, 28 Feb 2017 16:12:00 +0100
|
|
|
4aca6e |
Subject: [PATCH] iplink: bridge: add support for IFLA_BR_MCAST_SNOOPING
|
|
|
4aca6e |
|
|
|
4aca6e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289
|
|
|
4aca6e |
Upstream Status: iproute2.git commit 7ddd2d946cebf
|
|
|
4aca6e |
|
|
|
4aca6e |
commit 7ddd2d946cebf031c90d7b0d62b32bd880f7af8c
|
|
|
4aca6e |
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
|
|
|
4aca6e |
Date: Tue Feb 9 00:14:26 2016 +0100
|
|
|
4aca6e |
|
|
|
4aca6e |
iplink: bridge: add support for IFLA_BR_MCAST_SNOOPING
|
|
|
4aca6e |
|
|
|
4aca6e |
This patch implements support for the IFLA_BR_MCAST_SNOOPING attribute
|
|
|
4aca6e |
in iproute2 so it can change the multicast snooping value.
|
|
|
4aca6e |
|
|
|
4aca6e |
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
|
|
|
4aca6e |
---
|
|
|
4aca6e |
ip/iplink_bridge.c | 13 +++++++++++++
|
|
|
4aca6e |
1 file changed, 13 insertions(+)
|
|
|
4aca6e |
|
|
|
4aca6e |
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
|
|
|
4aca6e |
index 7c2165c..a216bd4 100644
|
|
|
4aca6e |
--- a/ip/iplink_bridge.c
|
|
|
4aca6e |
+++ b/ip/iplink_bridge.c
|
|
|
4aca6e |
@@ -33,6 +33,7 @@ static void print_explain(FILE *f)
|
|
|
4aca6e |
" [ vlan_filtering VLAN_FILTERING ]\n"
|
|
|
4aca6e |
" [ vlan_protocol VLAN_PROTOCOL ]\n"
|
|
|
4aca6e |
" [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
|
|
|
4aca6e |
+ " [ mcast_snooping MULTICAST_SNOOPING ]\n"
|
|
|
4aca6e |
" [ mcast_router MULTICAST_ROUTER ]\n"
|
|
|
4aca6e |
"\n"
|
|
|
4aca6e |
"Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n"
|
|
|
4aca6e |
@@ -155,6 +156,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
|
|
|
4aca6e |
invarg("invalid mcast_router", *argv);
|
|
|
4aca6e |
|
|
|
4aca6e |
addattr8(n, 1024, IFLA_BR_MCAST_ROUTER, mcast_router);
|
|
|
4aca6e |
+ } else if (matches(*argv, "mcast_snooping") == 0) {
|
|
|
4aca6e |
+ __u8 mcast_snoop;
|
|
|
4aca6e |
+
|
|
|
4aca6e |
+ NEXT_ARG();
|
|
|
4aca6e |
+ if (get_u8(&mcast_snoop, *argv, 0))
|
|
|
4aca6e |
+ invarg("invalid mcast_snooping", *argv);
|
|
|
4aca6e |
+
|
|
|
4aca6e |
+ addattr8(n, 1024, IFLA_BR_MCAST_SNOOPING, mcast_snoop);
|
|
|
4aca6e |
} else if (matches(*argv, "help") == 0) {
|
|
|
4aca6e |
explain();
|
|
|
4aca6e |
return -1;
|
|
|
4aca6e |
@@ -293,6 +302,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
|
|
|
4aca6e |
1 /*ARPHDR_ETHER*/, mac, sizeof(mac)));
|
|
|
4aca6e |
}
|
|
|
4aca6e |
|
|
|
4aca6e |
+ if (tb[IFLA_BR_MCAST_SNOOPING])
|
|
|
4aca6e |
+ fprintf(f, "mcast_snooping %u ",
|
|
|
4aca6e |
+ rta_getattr_u8(tb[IFLA_BR_MCAST_SNOOPING]));
|
|
|
4aca6e |
+
|
|
|
4aca6e |
if (tb[IFLA_BR_MCAST_ROUTER])
|
|
|
4aca6e |
fprintf(f, "mcast_router %u ",
|
|
|
4aca6e |
rta_getattr_u8(tb[IFLA_BR_MCAST_ROUTER]));
|
|
|
4aca6e |
--
|
|
|
4aca6e |
1.8.3.1
|
|
|
4aca6e |
|