From 4e6c30dc16307138c4af26258ad1206b62933364 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Tue, 28 Feb 2017 16:12:01 +0100
Subject: [PATCH] iplink: bridge: add support for
IFLA_BR_MCAST_MEMBERSHIP_INTVL
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289
Upstream Status: iproute2.git commit 7f3d559226458
commit 7f3d559226458b4b99e78c17080fd263a913e386
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Tue Feb 9 00:14:34 2016 +0100
iplink: bridge: add support for IFLA_BR_MCAST_MEMBERSHIP_INTVL
This patch implements support for the IFLA_BR_MCAST_MEMBERSHIP_INTVL
attribute in iproute2 so it can change the membership interval.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
ip/iplink_bridge.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 5d8810c..8f4c207 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -42,6 +42,7 @@ static void print_explain(FILE *f)
" [ mcast_last_member_count LAST_MEMBER_COUNT ]\n"
" [ mcast_startup_query_count STARTUP_QUERY_COUNT ]\n"
" [ mcast_last_member_interval LAST_MEMBER_INTERVAL ]\n"
+ " [ mcast_membership_interval MEMBERSHIP_INTERVAL ]\n"
"\n"
"Where: VLAN_PROTOCOL := { 802.1Q | 802.1ad }\n"
);
@@ -238,6 +239,17 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
addattr64(n, 1024, IFLA_BR_MCAST_LAST_MEMBER_INTVL,
mcast_last_member_intvl);
+ } else if (matches(*argv, "mcast_membership_interval") == 0) {
+ __u64 mcast_membership_intvl;
+
+ NEXT_ARG();
+ if (get_u64(&mcast_membership_intvl, *argv, 0)) {
+ invarg("invalid mcast_membership_interval",
+ *argv);
+ return -1;
+ }
+ addattr64(n, 1024, IFLA_BR_MCAST_MEMBERSHIP_INTVL,
+ mcast_membership_intvl);
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
@@ -411,6 +423,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL])
fprintf(f, "mcast_last_member_interval %llu ",
rta_getattr_u64(tb[IFLA_BR_MCAST_LAST_MEMBER_INTVL]));
+
+ if (tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL])
+ fprintf(f, "mcast_membership_interval %llu ",
+ rta_getattr_u64(tb[IFLA_BR_MCAST_MEMBERSHIP_INTVL]));
}
static void bridge_print_help(struct link_util *lu, int argc, char **argv,
--
1.8.3.1