[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251123165345.7131-1-stephen@networkplumber.org>
Date: Sun, 23 Nov 2025 08:53:06 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>,
Zhengyi Fu <i@...y.me>
Subject: [PATCH iproute2] tuntap: add missing brackets to json output
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 <i@...y.me>
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
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", "<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);
--
2.51.0
Powered by blists - more mailing lists