From c064d5fec3456de0b36f7eb317f146379af7b721 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 (cherry picked from commit 800867d85e5fae7d41131c2552dec290f2246077) --- bgpd/bgp_vty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 14f4fb7310..15ff0075d3 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -10249,6 +10249,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 */ filtered_count = 0; + 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