]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tuntap: add missing brackets to json output
authorStephen Hemminger <stephen@networkplumber.org>
Sun, 23 Nov 2025 16:49:49 +0000 (08:49 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 23 Nov 2025 16:49:49 +0000 (08:49 -0800)
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")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iptuntap.c

index b7018a6ff1ef2d0dcf671423942f4a8f2b384822..6718ec6cb316b58fc020e6acf66a61deb2dc1a7a 100644 (file)
@@ -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", "<NULL>");
@@ -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);