From 5bebe26d4e56a116b1b006c07f0ec4b455e70862 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Thu, 16 Apr 2020 13:15:32 -0400 Subject: [PATCH] zebra: don't print stale text if no GR info Don't print GR show output header if no GR info is present for a zapi client. Signed-off-by: Mark Stapp --- zebra/zserv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zebra/zserv.c b/zebra/zserv.c index e628dc6052..26023173b5 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -1108,12 +1108,17 @@ static void zebra_show_stale_client_detail(struct vty *vty, TAILQ_FOREACH (info, &client->gr_info_queue, gr_info) { if (first_p) { + vty_out(vty, "Stale Client Information\n"); + vty_out(vty, "------------------------\n"); + if (client->instance) vty_out(vty, " Instance: %u", client->instance); if (client->session_id) vty_out(vty, " [%u]", client->session_id); + first_p = false; } + vty_out(vty, "VRF : %s\n", vrf_id_to_name(info->vrf_id)); vty_out(vty, "Capabilities : "); switch (info->capabilities) { @@ -1248,8 +1253,7 @@ DEFUN (show_zebra_client, for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) { zebra_show_client_detail(vty, client); - vty_out(vty, "Stale Client Information\n"); - vty_out(vty, "------------------------\n"); + /* Show GR info if present */ zebra_show_stale_client_detail(vty, client); } -- 2.39.5