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