diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-11-28 16:16:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-28 16:16:24 +0100 |
commit | 8e1231d061bd0360f2599fc76fec5e63259764e8 (patch) | |
tree | 376378713d408998e7118063373abc458928ac6d /nhrpd | |
parent | Merge pull request #17491 from pguibert6WIND/bgp_evpn_rt5_routemap (diff) | |
parent | nhrpd: normalize sh ip nhrp opennhrp output (diff) | |
download | frr-8e1231d061bd0360f2599fc76fec5e63259764e8.tar.xz frr-8e1231d061bd0360f2599fc76fec5e63259764e8.zip |
Merge pull request #16700 from louis-6wind/fix-nhrp-output
nhrpd: fix show ip nhrp output
Diffstat (limited to 'nhrpd')
-rw-r--r-- | nhrpd/nhrp_vty.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index 199f4d75d..cae93c6e5 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -933,6 +933,10 @@ 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])); if (c->cur.peer) sockunion2str(&c->cur.peer->vc->remote.nbma, buf[1], @@ -985,8 +989,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, @@ -1030,7 +1032,6 @@ DEFUN(show_ip_nhrp, show_ip_nhrp_cmd, else json_object_string_add(json_vrf, "status", "ok"); - ctx.count++; FOR_ALL_INTERFACES (vrf, ifp) nhrp_cache_foreach(ifp, show_ip_opennhrp_cache, &ctx); } |