Blame SOURCES/0064-iplink-bridge-add-support-for-IFLA_BR_GROUP_ADDR.patch

4aca6e
From 070419b6c1eec0a88a464bcfcd8a3a3755f19ffc 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_GROUP_ADDR
4aca6e
4aca6e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1417289
4aca6e
Upstream Status: iproute2.git commit 0a61aa3963e25
4aca6e
4aca6e
commit 0a61aa3963e25a32e82cad8cdd04f31532ec5b3f
4aca6e
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
4aca6e
Date:   Tue Feb 9 00:14:23 2016 +0100
4aca6e
4aca6e
    iplink: bridge: add support for IFLA_BR_GROUP_ADDR
4aca6e
4aca6e
    This patch implements support for the IFLA_BR_GROUP_ADDR attribute
4aca6e
    in iproute2 so it can change the group address.
4aca6e
4aca6e
    Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
4aca6e
---
4aca6e
 ip/iplink_bridge.c | 19 +++++++++++++++++++
4aca6e
 1 file changed, 19 insertions(+)
4aca6e
4aca6e
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
4aca6e
index 77d4ee1..6ef6c4b 100644
4aca6e
--- a/ip/iplink_bridge.c
4aca6e
+++ b/ip/iplink_bridge.c
4aca6e
@@ -29,6 +29,7 @@ static void print_explain(FILE *f)
4aca6e
 		"                  [ stp_state STP_STATE ]\n"
4aca6e
 		"                  [ priority PRIORITY ]\n"
4aca6e
 		"                  [ group_fwd_mask MASK ]\n"
4aca6e
+		"                  [ group_address ADDRESS ]\n"
4aca6e
 		"                  [ vlan_filtering VLAN_FILTERING ]\n"
4aca6e
 		"                  [ vlan_protocol VLAN_PROTOCOL ]\n"
4aca6e
 		"\n"
4aca6e
@@ -126,6 +127,15 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
4aca6e
 				invarg("invalid group_fwd_mask", *argv);
4aca6e
 
4aca6e
 			addattr16(n, 1024, IFLA_BR_GROUP_FWD_MASK, fwd_mask);
4aca6e
+		} else if (matches(*argv, "group_address") == 0) {
4aca6e
+			char llabuf[32];
4aca6e
+			int len;
4aca6e
+
4aca6e
+			NEXT_ARG();
4aca6e
+			len = ll_addr_a2n(llabuf, sizeof(llabuf), *argv);
4aca6e
+			if (len < 0)
4aca6e
+				return -1;
4aca6e
+			addattr_l(n, 1024, IFLA_BR_GROUP_ADDR, llabuf, len);
4aca6e
 		} else if (matches(*argv, "help") == 0) {
4aca6e
 			explain();
4aca6e
 			return -1;
4aca6e
@@ -250,6 +260,15 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
4aca6e
 	if (tb[IFLA_BR_GROUP_FWD_MASK])
4aca6e
 		fprintf(f, "group_fwd_mask %#x ",
4aca6e
 			rta_getattr_u16(tb[IFLA_BR_GROUP_FWD_MASK]));
4aca6e
+
4aca6e
+	if (tb[IFLA_BR_GROUP_ADDR]) {
4aca6e
+		SPRINT_BUF(mac);
4aca6e
+
4aca6e
+		fprintf(f, "group_address %s ",
4aca6e
+			ll_addr_n2a(RTA_DATA(tb[IFLA_BR_GROUP_ADDR]),
4aca6e
+				    RTA_PAYLOAD(tb[IFLA_BR_GROUP_ADDR]),
4aca6e
+				    1 /*ARPHDR_ETHER*/, mac, sizeof(mac)));
4aca6e
+	}
4aca6e
 }
4aca6e
 
4aca6e
 static void bridge_print_help(struct link_util *lu, int argc, char **argv,
4aca6e
-- 
4aca6e
1.8.3.1
4aca6e