[PATCH] bgpd: fix show ip bgp summary json command for dynamicPeers

Dongling Duan dlduan at amazon.com
Thu Jul 26 18:18:10 EDT 2018


Signed-off-by: Dongling Duan <dlduan at amazon.com>
---
 bgpd/bgp_vty.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 2acf39a..27d4f7a 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -7909,9 +7909,11 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
 		if (use_json) {
 			json_peer = json_object_new_object();
 
-			if (peer_dynamic_neighbor(peer))
+			if (peer_dynamic_neighbor(peer)) {
+				dn_count++;
 				json_object_boolean_true_add(json_peer,
 							     "dynamicPeer");
+			}
 
 			if (peer->hostname)
 				json_object_string_add(json_peer, "hostname",
-- 
2.7.3.AMZN




More information about the dev mailing list