summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Bernat <vincent@bernat.ch>2020-11-17 20:29:31 +0100
committerVincent Bernat <vincent@bernat.ch>2020-11-17 20:29:31 +0100
commit266ae3aa532d26d4e4ed2d1d1ca5887bb2ac882e (patch)
treeb2e2e3260aaf3db208f18366a9ae23daedf37c1c
parentMerge pull request #6851 from kuldeepkash/bgp_graceful_restart (diff)
downloadfrr-266ae3aa532d26d4e4ed2d1d1ca5887bb2ac882e.tar.xz
frr-266ae3aa532d26d4e4ed2d1d1ca5887bb2ac882e.zip
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 <vincent@bernat.ch>
-rw-r--r--bgpd/bgp_vty.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 40e970786..72a01fa99 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",