From 2bb5d39b14cf25ea118c144cfae9b5945dbace1a Mon Sep 17 00:00:00 2001 From: bisdhdh Date: Thu, 24 Oct 2019 09:04:05 +0530 Subject: [PATCH] =?UTF-8?q?bgpd:=20show=20BGP=20GR=20Neighbor=20mode=20as?= =?UTF-8?q?=20=E2=80=9CNotApplicable=E2=80=9D,when=20local=20mode=20is=20?= =?UTF-8?q?=E2=80=9CDisable=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BGP GR Neighbor mode is showing the default string as “NotRecieved”, as the bgp gr neighbour capability was not processed, since the local mode is “Disable”. However now it would be changed to “NotApplicable”. Signed-off-by: Biswajit Sadhu --- bgpd/bgp_vty.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 896d1f0e89..bca28150e4 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9368,13 +9368,12 @@ static void bgp_show_neighbor_graceful_restart_remote_mode( bool use_json, json_object *json) { - const char *mode = "NotReceived"; + const char *mode = "NotApplicable"; if (!use_json) vty_out(vty, "\n Remote GR Mode : "); if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_ADV) && - (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) && (peer->status == Established)) { if ((peer->nsf_af_count == 0) && @@ -9383,12 +9382,14 @@ static void bgp_show_neighbor_graceful_restart_remote_mode( /*Gr disabled case*/ mode = "Disable"; - } else if (peer->nsf_af_count == 0) { + } else if (peer->nsf_af_count == 0 && + CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) { /* Helper */ mode = "Helper"; - } else if (peer->nsf_af_count != 0) { + } else if (peer->nsf_af_count != 0 && + CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV)) { /* Restart */ mode = "Restart";