Blame SOURCES/0095-bridge-add-support-for-the-multicast-flood-flag.patch

4aca6e
From b13ed2eea122977b06091fe4dc1f885ac24ff168 Mon Sep 17 00:00:00 2001
4aca6e
From: Phil Sutter <psutter@redhat.com>
4aca6e
Date: Tue, 28 Feb 2017 16:13:18 +0100
4aca6e
Subject: [PATCH] bridge: add support for the multicast flood flag
4aca6e
4aca6e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289
4aca6e
Upstream Status: iproute2.git commit 9208b4e7c9834
4aca6e
4aca6e
commit 9208b4e7c983447368c43e4cdc3d2cfce9e19069
4aca6e
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
4aca6e
Date:   Thu Oct 13 17:54:20 2016 +0200
4aca6e
4aca6e
    bridge: add support for the multicast flood flag
4aca6e
4aca6e
    Recently a new per-port flag was added which controls the flooding of
4aca6e
    unknown multicast, this patch adds support for controlling it via iproute2.
4aca6e
    It also updates the man pages with information about the new flag.
4aca6e
4aca6e
    Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
4aca6e
---
4aca6e
 bridge/link.c            | 12 ++++++++++++
4aca6e
 ip/iplink_bridge_slave.c |  9 +++++++++
4aca6e
 man/man8/bridge.8        |  7 ++++++-
4aca6e
 man/man8/ip-link.8.in    |  7 ++++++-
4aca6e
 4 files changed, 33 insertions(+), 2 deletions(-)
4aca6e
4aca6e
diff --git a/bridge/link.c b/bridge/link.c
4aca6e
index 353e1c3..da49469 100644
4aca6e
--- a/bridge/link.c
4aca6e
+++ b/bridge/link.c
4aca6e
@@ -195,6 +195,9 @@ int print_linkinfo(const struct sockaddr_nl *who,
4aca6e
 				if (prtb[IFLA_BRPORT_UNICAST_FLOOD])
4aca6e
 					print_onoff(fp, "flood",
4aca6e
 						    rta_getattr_u8(prtb[IFLA_BRPORT_UNICAST_FLOOD]));
4aca6e
+				if (prtb[IFLA_BRPORT_MCAST_FLOOD])
4aca6e
+					print_onoff(fp, "mcast_flood",
4aca6e
+						    rta_getattr_u8(prtb[IFLA_BRPORT_MCAST_FLOOD]));
4aca6e
 			}
4aca6e
 		} else
4aca6e
 			print_portstate(fp, rta_getattr_u8(tb[IFLA_PROTINFO]));
4aca6e
@@ -227,6 +230,7 @@ static void usage(void)
4aca6e
 	fprintf(stderr,	"                               [ learning {on | off} ]\n");
4aca6e
 	fprintf(stderr,	"                               [ learning_sync {on | off} ]\n");
4aca6e
 	fprintf(stderr,	"                               [ flood {on | off} ]\n");
4aca6e
+	fprintf(stderr,	"                               [ mcast_flood {on | off} ]\n");
4aca6e
 	fprintf(stderr, "                               [ hwmode {vepa | veb} ]\n");
4aca6e
 	fprintf(stderr, "                               [ self ] [ master ]\n");
4aca6e
 	fprintf(stderr, "       bridge link show [dev DEV]\n");
4aca6e
@@ -260,6 +264,7 @@ static int brlink_modify(int argc, char **argv)
4aca6e
 	__s8 learning = -1;
4aca6e
 	__s8 learning_sync = -1;
4aca6e
 	__s8 flood = -1;
4aca6e
+	__s8 mcast_flood = -1;
4aca6e
 	__s8 hairpin = -1;
4aca6e
 	__s8 bpdu_guard = -1;
4aca6e
 	__s8 fast_leave = -1;
4aca6e
@@ -310,6 +315,10 @@ static int brlink_modify(int argc, char **argv)
4aca6e
 			NEXT_ARG();
4aca6e
 			if (!on_off("flood", &flood, *argv))
4aca6e
 				return -1;
4aca6e
+		} else if (strcmp(*argv, "mcast_flood") == 0) {
4aca6e
+			NEXT_ARG();
4aca6e
+			if (!on_off("mcast_flood", &mcast_flood, *argv))
4aca6e
+				return -1;
4aca6e
 		} else if (strcmp(*argv, "cost") == 0) {
4aca6e
 			NEXT_ARG();
4aca6e
 			cost = atoi(*argv);
4aca6e
@@ -382,6 +391,9 @@ static int brlink_modify(int argc, char **argv)
4aca6e
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_PROTECT, root_block);
4aca6e
 	if (flood >= 0)
4aca6e
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_UNICAST_FLOOD, flood);
4aca6e
+	if (mcast_flood >= 0)
4aca6e
+		addattr8(&req.n, sizeof(req), IFLA_BRPORT_MCAST_FLOOD,
4aca6e
+			 mcast_flood);
4aca6e
 	if (learning >= 0)
4aca6e
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_LEARNING, learning);
4aca6e
 	if (learning_sync >= 0)
4aca6e
diff --git a/ip/iplink_bridge_slave.c b/ip/iplink_bridge_slave.c
4aca6e
index 3ec2bba..95efca8 100644
4aca6e
--- a/ip/iplink_bridge_slave.c
4aca6e
+++ b/ip/iplink_bridge_slave.c
4aca6e
@@ -33,6 +33,7 @@ static void print_explain(FILE *f)
4aca6e
 		"                        [ proxy_arp_wifi {on | off} ]\n"
4aca6e
 		"                        [ mcast_router MULTICAST_ROUTER ]\n"
4aca6e
 		"                        [ mcast_fast_leave {on | off} ]\n"
4aca6e
+		"                        [ mcast_flood {on | off} ]\n"
4aca6e
 	);
4aca6e
 }
4aca6e
 
4aca6e
@@ -187,6 +188,10 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
4aca6e
 	if (tb[IFLA_BRPORT_FAST_LEAVE])
4aca6e
 		print_onoff(f, "mcast_fast_leave",
4aca6e
 			    rta_getattr_u8(tb[IFLA_BRPORT_FAST_LEAVE]));
4aca6e
+
4aca6e
+	if (tb[IFLA_BRPORT_MCAST_FLOOD])
4aca6e
+		print_onoff(f, "mcast_flood",
4aca6e
+			rta_getattr_u8(tb[IFLA_BRPORT_MCAST_FLOOD]));
4aca6e
 }
4aca6e
 
4aca6e
 static void bridge_slave_parse_on_off(char *arg_name, char *arg_val,
4aca6e
@@ -251,6 +256,10 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv,
4aca6e
 			NEXT_ARG();
4aca6e
 			bridge_slave_parse_on_off("flood", *argv, n,
4aca6e
 						  IFLA_BRPORT_UNICAST_FLOOD);
4aca6e
+		} else if (matches(*argv, "mcast_flood") == 0) {
4aca6e
+			NEXT_ARG();
4aca6e
+			bridge_slave_parse_on_off("mcast_flood", *argv, n,
4aca6e
+						  IFLA_BRPORT_MCAST_FLOOD);
4aca6e
 		} else if (matches(*argv, "proxy_arp") == 0) {
4aca6e
 			NEXT_ARG();
4aca6e
 			bridge_slave_parse_on_off("proxy_arp", *argv, n,
4aca6e
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
4aca6e
index c09b8c3..77124bb 100644
4aca6e
--- a/man/man8/bridge.8
4aca6e
+++ b/man/man8/bridge.8
4aca6e
@@ -42,7 +42,8 @@ bridge \- show / manipulate bridge addresses and devices
4aca6e
 .BR learning_sync " { " on " | " off " } ] [ "
4aca6e
 .BR flood " { " on " | " off " } ] [ "
4aca6e
 .BR hwmode " { " vepa " | " veb " } ] [ "
4aca6e
-.BR self " ] [ " master " ] "
4aca6e
+.BR mcast_flood " { " on " | " off " } ] [ "
4aca6e
+.BR self " ] [ " master " ]"
4aca6e
 
4aca6e
 .ti -8
4aca6e
 .BR "bridge link" " [ " show " ] [ "
4aca6e
@@ -305,6 +306,10 @@ switch.
4aca6e
 - bridging happens in hardware.
4aca6e
 
4aca6e
 .TP
4aca6e
+.BR "mcast_flood on " or " mcast_flood off "
4aca6e
+Controls whether a given port will be flooded with multicast traffic for which there is no MDB entry. By default this flag is on.
4aca6e
+
4aca6e
+.TP
4aca6e
 .BI self
4aca6e
 link setting is configured on specified physical device
4aca6e
 
4aca6e
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
4aca6e
index 38e5416..8030203 100644
4aca6e
--- a/man/man8/ip-link.8.in
4aca6e
+++ b/man/man8/ip-link.8.in
4aca6e
@@ -1144,7 +1144,9 @@ the following additional arguments are supported:
4aca6e
 ] [
4aca6e
 .BI mcast_router " MULTICAST_ROUTER"
4aca6e
 ] [
4aca6e
-.BR mcast_fast_leave " { " on " | " off "} ]"
4aca6e
+.BR mcast_fast_leave " { " on " | " off "}"
4aca6e
+] [
4aca6e
+.BR mcast_flood " { " on " | " off " } ]"
4aca6e
 
4aca6e
 .in +8
4aca6e
 .sp
4aca6e
@@ -1213,6 +1215,9 @@ queries.
4aca6e
 .B fastleave
4aca6e
 option above.
4aca6e
 
4aca6e
+.BR mcast_flood " { " on " | " off " }"
4aca6e
+- controls whether a given port will be flooded with multicast traffic for which there is no MDB entry.
4aca6e
+
4aca6e
 .in -8
4aca6e
 
4aca6e
 .TP
4aca6e
-- 
4aca6e
1.8.3.1
4aca6e