summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2022-09-05 14:12:14 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2024-05-23 14:43:21 +0200
commitc3ccc0a53ba731c7995c3c8407665878f5a3cf34 (patch)
treeeb02c12f2d45231ea109449205bb5e24cab1eb69
parentisisd: fix display of srv6 subsubtlvs (diff)
downloadfrr-c3ccc0a53ba731c7995c3c8407665878f5a3cf34.tar.xz
frr-c3ccc0a53ba731c7995c3c8407665878f5a3cf34.zip
isisd: fix non present level display is show isis database detail json
When a level is not present in show isis database detail json, {} is displayed. Display nothing for non present level. Fixes: a2cac12a63 ("isisd: Add json to show isis database command.") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
-rw-r--r--isisd/isisd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/isisd/isisd.c b/isisd/isisd.c
index 2c4cee060..982df0839 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -2748,6 +2748,8 @@ static void show_isis_database_json(struct json_object *json, const char *sysid_
json_object_object_add(area_json,"area",tag_area_json);
json_object_object_add(area_json,"levels",arr_json);
for (level = 0; level < ISIS_LEVELS; level++) {
+ if (lspdb_count(&area->lspdb[level]) == 0)
+ continue;
lsp_json = json_object_new_object();
show_isis_database_lspdb_json(lsp_json, area, level,
&area->lspdb[level],