]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: fix vlan show stats formatting
authorTobias Jungel <tobias.jungel@bisdn.de>
Fri, 26 Oct 2018 21:51:03 +0000 (23:51 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 29 Oct 2018 16:58:03 +0000 (09:58 -0700)
The output of -statistics vlan show was broken previous change for json
output. This aligns the format to vlan show.

v2: fixed too greedy deletion that caused a -Wmaybe-uninitialized

Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/vlan.c

index a111d5e6643960b1124a7f23a5db614dd4bfe206..d075a42d139b49f60a9e21af7307f27d83342e3a 100644 (file)
@@ -484,7 +484,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)
        rem = RTA_PAYLOAD(list);
 
        ifname = ll_index_to_name(ifindex);
-       open_json_object(ifname);
+       open_vlan_port(ifindex);
 
        print_color_string(PRINT_FP, COLOR_IFNAME,
                           NULL, "%-16s", ifname);
@@ -505,8 +505,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)
 
                print_one_vlan_stats(vstats);
        }
-       close_json_object();
-
+       close_vlan_port();
 }
 
 static int print_vlan_stats(struct nlmsghdr *n, void *arg)