From a47a53b003e7a467d2c3c7659a6e5a496b0ad7cb Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 13 Mar 2025 11:29:39 +0100 Subject: [PATCH] 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: 856ca177c4bb ("Added json formating support to show-...-neighbors-... bgp commands.") Signed-off-by: Philippe Guibert --- bgpd/bgp_vty.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 0b0ed79baf..9d56c9af89 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -14089,9 +14089,14 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi, ? "Advertise" : "Withdraw"); - /* Receive prefix count */ - vty_out(vty, " %u accepted prefixes\n", - p->pcount[afi][safi]); + /* 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]); /* maximum-prefix-out */ if (CHECK_FLAG(p->af_flags[afi][safi], -- 2.39.5