From a86ae0b0475aef00435b503628b3bf4faeb4a599 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 24 Feb 2016 10:49:04 +0100 Subject: [PATCH] iplink_bridge: add support for stp_state Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1270759 Upstream Status: iproute2.git commit dab049628a8e5 commit dab049628a8e5e962ecc9edf9e37ac858ce3200b Author: Nikolay Aleksandrov Date: Tue Jun 16 13:38:48 2015 +0300 iplink_bridge: add support for stp_state This patch adds support to set stp_state via IFLA_BR_STP_STATE. Signed-off-by: Nikolay Aleksandrov --- ip/iplink_bridge.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c index 2726a36..79b9e04 100644 --- a/ip/iplink_bridge.c +++ b/ip/iplink_bridge.c @@ -24,6 +24,7 @@ static void explain(void) " [ hello_time HELLO_TIME ]\n" " [ max_age MAX_AGE ]\n" " [ ageing_time AGEING_TIME ]\n" + " [ stp_state STP_STATE ]\n" ); } @@ -61,6 +62,13 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv, return -1; } addattr32(n, 1024, IFLA_BR_AGEING_TIME, val); + } else if (matches(*argv, "stp_state") == 0) { + NEXT_ARG(); + if (get_u32(&val, *argv, 0)) { + invarg("invalid stp_state", *argv); + return -1; + } + addattr32(n, 1024, IFLA_BR_STP_STATE, val); } else if (matches(*argv, "help") == 0) { explain(); return -1; -- 1.8.3.1