naccyde / rpms / iproute

Forked from rpms/iproute 5 months ago
Clone

Blame SOURCES/0075-iplink_bridge-add-support-for-priority.patch

049c96
From 8b3aa8fa4f5e02ba2f49b4030299e6f75fdf1072 Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Wed, 24 Feb 2016 10:49:04 +0100
049c96
Subject: [PATCH] iplink_bridge: add support for priority
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1270759
049c96
Upstream Status: iproute2.git commit b0197a047e5c4
049c96
049c96
commit b0197a047e5c41a37d5dd724290eadd5b9353558
049c96
Author: Nikolay Aleksandrov <razor@blackwall.org>
049c96
Date:   Tue Jun 16 13:38:49 2015 +0300
049c96
049c96
    iplink_bridge: add support for priority
049c96
049c96
    This patch adds support to set bridge stp priority via IFLA_BR_PRIORITY.
049c96
049c96
    Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
049c96
---
049c96
 ip/iplink_bridge.c | 10 ++++++++++
049c96
 1 file changed, 10 insertions(+)
049c96
049c96
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
049c96
index 79b9e04..297160c 100644
049c96
--- a/ip/iplink_bridge.c
049c96
+++ b/ip/iplink_bridge.c
049c96
@@ -25,6 +25,7 @@ static void explain(void)
049c96
 		"                  [ max_age MAX_AGE ]\n"
049c96
 		"                  [ ageing_time AGEING_TIME ]\n"
049c96
 		"                  [ stp_state STP_STATE ]\n"
049c96
+		"                  [ priority PRIORITY ]\n"
049c96
 	);
049c96
 }
049c96
 
049c96
@@ -69,6 +70,15 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
049c96
 				return -1;
049c96
 			}
049c96
 			addattr32(n, 1024, IFLA_BR_STP_STATE, val);
049c96
+		} else if (matches(*argv, "priority") == 0) {
049c96
+			__u16 prio;
049c96
+
049c96
+			NEXT_ARG();
049c96
+			if (get_u16(&prio, *argv, 0)) {
049c96
+				invarg("invalid priority", *argv);
049c96
+				return -1;
049c96
+			}
049c96
+			addattr16(n, 1024, IFLA_BR_PRIORITY, prio);
049c96
 		} else if (matches(*argv, "help") == 0) {
049c96
 			explain();
049c96
 			return -1;
049c96
-- 
049c96
1.8.3.1
049c96