The set of processes attached to tuntap are displayed as JSON array, but was missing the inner brackets to allow for multiple processes. Fixes: 689bef5dc97a ("tuntap: support JSON output") Reported-by: Zhengyi Fu Signed-off-by: Stephen Hemminger --- ip/iptuntap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ip/iptuntap.c b/ip/iptuntap.c index b7018a6f..6718ec6c 100644 --- a/ip/iptuntap.c +++ b/ip/iptuntap.c @@ -314,6 +314,7 @@ static void show_processes(const char *name) !strcmp(name, value)) { SPRINT_BUF(pname); + open_json_object(NULL); if (get_task_name(pid, pname, sizeof(pname))) print_string(PRINT_ANY, "name", "%s", ""); @@ -322,6 +323,7 @@ static void show_processes(const char *name) "%s", pname); print_uint(PRINT_ANY, "pid", "(%d)", pid); + close_json_object(); } free(key); -- 2.51.0