From 7c08ff1474413f2cd93f3e3e4509de5c4eedc65a Mon Sep 17 00:00:00 2001 From: Abhishek Naik Date: Tue, 19 Oct 2021 23:45:26 +0000 Subject: [PATCH] bgpd: Reset dynamic peer counter Dynamic peer count is inconsistent in "show bgp summary json" and "show bgp summary failed json" due to dynamic peer counter 'dn_count' being reused without resetting Signed-off-by: Abhishek Naik --- bgpd/bgp_vty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 1957767443..3c0b10ac87 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9715,6 +9715,7 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, } count = 0; /* Reset the value as its used again */ + dn_count = 0; for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) { if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE)) continue; -- 2.39.5