bgpd: fix add prefix sent in 'show bgp neighbor'

The 'acceptedPrefixCounter' is available in 'show bgp neighbor json', but
there is no equivalent when using the non json output. Add it.

> # show bgp neighbor
> [..]
>  Community attribute sent to this neighbor(all)
>  0 accepted prefixes, 1 sent prefixes

Fixes: 856ca177c4 ("Added json formating support to show-...-neighbors-... bgp commands.")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2025-03-13 11:29:39 +01:00
parent f28394313f
commit a47a53b003

View file

@ -14089,7 +14089,12 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
? "Advertise"
: "Withdraw");
/* Receive prefix count */
/* Receive and sent prefix count, if available */
paf = peer_af_find(p, afi, safi);
if (paf && PAF_SUBGRP(paf))
vty_out(vty, " %u accepted, %u sent prefixes\n",
p->pcount[afi][safi], PAF_SUBGRP(paf)->scount);
else
vty_out(vty, " %u accepted prefixes\n",
p->pcount[afi][safi]);