From 9199a725f42662ac882f675a060ec2ac9f8b0219 Mon Sep 17 00:00:00 2001 From: Tigran Martirosyan Date: Sat, 30 Jun 2018 16:27:25 +0400 Subject: [PATCH] fixed #2567: Json status of BGP peer is not updated properly --- bgpd/bgp_vty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 189b2f0ba9..86f3f97c49 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -7935,6 +7935,11 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN)) json_object_string_add(json_peer, "state", "Idle (Admin)"); + else if (peer->afc_recv[afi][safi]) + json_object_string_add( + json_peer, "state", + lookup_msg(bgp_status_msg, peer->status, + NULL)); else if (CHECK_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW)) json_object_string_add(json_peer, "state", -- 2.39.5