]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: show BGP GR Neighbor mode as “NotApplicable”,when local mode is “Disable”.
authorbisdhdh <biswajit.sadhu@gmail.com>
Thu, 24 Oct 2019 03:34:05 +0000 (09:04 +0530)
committerbisdhdh <biswajit.sadhu@gmail.com>
Thu, 23 Jan 2020 04:04:25 +0000 (09:34 +0530)
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 <sadhub@vmware.com>
bgpd/bgp_vty.c

index 896d1f0e896ab2b6a27932901160b2ea4225a9c6..bca28150e4feae97d0f2d7c708602102674245dc 100644 (file)
@@ -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";