[PATCH 7/8] alfred: vis: fix jsondoc output for nodes without vis entries

Sven Eckelmann <[email protected]> Tue, 28 Jul 2026 18:01:36 +0200
Newsgroups org.open-mesh.lists.batman
Message-ID <[email protected]>
vis_read_answer() skipped the entries handler when a received vis record
contained no entries. For the jsondoc format, the per-node object is opened
by vis_jsondoc_interfaces() but only closed at the end of
vis_jsondoc_entries().

The entries handler must always be called and all entry handlers must
handled `entries_n == 0`.

Fixes: 38eae4d50e81 ("vis: Add an output format which is json conformant.")
Signed-off-by: Sven Eckelmann <[email protected]>
---
 vis/vis.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/vis/vis.c b/vis/vis.c
index 93f444b..025745d 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -1046,10 +1046,6 @@ static int vis_read_answer(struct globals *globals)
 		vis_entries = (struct vis_entry *) &ifaces[vis_data->iface_n];
 
 		ops->interfaces(vis_data->iface_n, ifaces);
-
-		if (vis_data->entries_n == 0)
-			continue;
-
 		ops->entries(vis_data->entries_n, vis_entries,
 			     vis_data->iface_n, ifaces);
 	}

-- 
2.47.3