]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iplink_bridge: add support for stp_state
authorNikolay Aleksandrov <razor@blackwall.org>
Tue, 16 Jun 2015 10:38:48 +0000 (13:38 +0300)
committerStephen Hemminger <shemming@brocade.com>
Fri, 26 Jun 2015 04:06:45 +0000 (00:06 -0400)
This patch adds support to set stp_state via IFLA_BR_STP_STATE.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
ip/iplink_bridge.c

index 2726a369803eb3c48c12820bf5d67f25a492ab49..79b9e049ff9299da16738c7079dd93db879c8094 100644 (file)
@@ -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;