From: Vincent Bernat Date: Tue, 17 Nov 2020 19:29:31 +0000 (+0100) Subject: bgpd: identify passive connections in JSON summary X-Git-Tag: base_7.6~260^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=266ae3aa532d26d4e4ed2d1d1ca5887bb2ac882e;p=mirror%2Ffrr.git bgpd: identify passive connections in JSON summary When using non JSON output, passive connections are marked with: BGP state = Active (passive) However, such an information is not available in JSON output. This commit adds that. It also adds "Active (NSF passive)" flag, like the regular output. Signed-off-by: Vincent Bernat --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 40e9707866..72a01fa99c 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -10832,6 +10832,14 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, BGP_FLAG_SHUTDOWN)) json_object_string_add(json_peer, "state", "Idle (Admin)"); + else if (peer->status == Active + && CHECK_FLAG(peer->flags, PEER_FLAG_PASSIVE)) + json_object_string_add(json_peer, "state", + "Active (passive)"); + else if (peer->status == Active + && CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT)) + json_object_string_add(json_peer, "state", + "Active (NSF passive)"); else if (peer->afc_recv[afi][safi]) json_object_string_add( json_peer, "state",