]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iplink: bridge: export root_(port|path_cost), topology_change and change_detected
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Mon, 8 Feb 2016 23:14:20 +0000 (00:14 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 9 Feb 2016 18:42:03 +0000 (10:42 -0800)
Netlink already export these values, we just need to make them visible.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
ip/iplink_bridge.c

index 3bbbcaa120cf0a1cb83586e9356bd0337e882ec2..33ffa6c27f030481e192ed004ab77812430b7531 100644 (file)
@@ -181,6 +181,22 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
                                  sizeof(root_id));
                fprintf(f, "designated_root %s ", root_id);
        }
+
+       if (tb[IFLA_BR_ROOT_PORT])
+               fprintf(f, "root_port %u ",
+                       rta_getattr_u16(tb[IFLA_BR_ROOT_PORT]));
+
+       if (tb[IFLA_BR_ROOT_PATH_COST])
+               fprintf(f, "root_path_cost %u ",
+                       rta_getattr_u32(tb[IFLA_BR_ROOT_PATH_COST]));
+
+       if (tb[IFLA_BR_TOPOLOGY_CHANGE])
+               fprintf(f, "topology_change %u ",
+                       rta_getattr_u8(tb[IFLA_BR_TOPOLOGY_CHANGE]));
+
+       if (tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED])
+               fprintf(f, "topology_change_detected %u ",
+                       rta_getattr_u8(tb[IFLA_BR_TOPOLOGY_CHANGE_DETECTED]));
 }
 
 static void bridge_print_help(struct link_util *lu, int argc, char **argv,