From e2db455c0144f2732e0dd681942f2c489e4b5d85 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Fri, 30 Aug 2024 17:53:31 +0200 Subject: [PATCH] nhrpd: normalize sh ip nhrp opennhrp output The command outputs too much "\n". Normalize it. Signed-off-by: Louis Scalbert --- nhrpd/nhrp_vty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index 0fc3dee98d37..5db1327b024d 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -934,6 +934,8 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx) if (ctx->afi != family2afi(sockunion_family(&c->remote_addr))) return; + if (ctx->count && !ctx->json) + vty_out(ctx->vty, "\n"); ctx->count++; sockunion2str(&c->remote_addr, buf[0], sizeof(buf[0])); @@ -988,8 +990,6 @@ static void show_ip_opennhrp_cache(struct nhrp_cache *c, void *pctx) if (sockunion_family(&c->cur.remote_nbma_natoa) != AF_UNSPEC) vty_out(ctx->vty, "NBMA-NAT-OA-Address: %s\n", buf[2]); - - vty_out(ctx->vty, "\n\n"); } DEFUN(show_ip_nhrp, show_ip_nhrp_cmd,