From 3ae589b8a51057523a3c8d2466aad23b40d4d4b5 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Tue, 18 Apr 2023 17:35:41 +0200 Subject: [PATCH] isisd: fix add an algorithm argument to show isis route "show isis route algorithm ALGO json" display some text output before printing the JSON one. Do not print the text output in JSON mode. Fixes: 0833c25180 ("isisd: add an algorithm argument to show isis route") Signed-off-by: Louis Scalbert --- isisd/isis_spf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 732853796a..466e96b3a2 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -2884,7 +2884,8 @@ static void show_isis_route_common(struct vty *vty, int levels, spftree = area->spftree[SPFTREE_IPV4] [level - 1]; - isis_print_spftree(vty, spftree); + if (!json) + isis_print_spftree(vty, spftree); isis_print_routes(vty, spftree, json ? &json_val : NULL, @@ -2905,7 +2906,8 @@ static void show_isis_route_common(struct vty *vty, int levels, spftree = area->spftree[SPFTREE_IPV6] [level - 1]; - isis_print_spftree(vty, spftree); + if (!json) + isis_print_spftree(vty, spftree); isis_print_routes(vty, spftree, json ? &json_val : NULL, @@ -2927,7 +2929,8 @@ static void show_isis_route_common(struct vty *vty, int levels, spftree = area->spftree[SPFTREE_DSTSRC] [level - 1]; - isis_print_spftree(vty, spftree); + if (!json) + isis_print_spftree(vty, spftree); isis_print_routes(vty, spftree, json ? &json_val : NULL, prefix_sid, backup);