]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix add prefix sent in 'show bgp neighbor' 18376/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 13 Mar 2025 10:29:39 +0000 (11:29 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 10 Apr 2025 08:12:36 +0000 (10:12 +0200)
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 <philippe.guibert@6wind.com>
bgpd/bgp_vty.c

index 0b0ed79baf384e1b4aeaf25a770a97cd7558901f..9d56c9af890545981b99403369dcbc53c89df582 100644 (file)
@@ -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],