ip: iplink.c: open/close json obj for ip -brief -json link show dev DEV

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin 2017-08-17 10:35:53 -07:00 committed by Stephen Hemminger
parent d0e720111a
commit e4a1216aeb
1 changed files with 2 additions and 0 deletions

View File

@ -1041,10 +1041,12 @@ int iplink_get(unsigned int flags, char *name, __u32 filt_mask)
if (rtnl_talk(&rth, &req.n, &answer.n, sizeof(answer)) < 0)
return -2;
open_json_object(NULL);
if (brief)
print_linkinfo_brief(NULL, &answer.n, stdout, NULL);
else
print_linkinfo(NULL, &answer.n, stdout);
close_json_object();
return 0;
}