From 8ff3d1d3a33537088fa184a9c74bb8eb063720b2 Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Tue, 12 Mar 2019 18:41:26 +0200 Subject: [PATCH] ip: xstats: add json output support This adds only initial object support if json argument is specified. Later patches convert the current xstats users to json. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David Ahern --- ip/iplink_xstats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ip/iplink_xstats.c b/ip/iplink_xstats.c index 908d9228..c64e6885 100644 --- a/ip/iplink_xstats.c +++ b/ip/iplink_xstats.c @@ -70,10 +70,13 @@ int iplink_ifla_xstats(int argc, char **argv) return -1; } + new_json_obj(json); if (rtnl_dump_filter(&rth, lu->print_ifla_xstats, stdout) < 0) { + delete_json_obj(); fprintf(stderr, "Dump terminated\n"); return -1; } + delete_json_obj(); return 0; } -- 2.39.5