]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Apply NOOP when doing negative commands for GR operations
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 30 Apr 2024 10:40:08 +0000 (13:40 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 7 May 2024 13:58:04 +0000 (13:58 +0000)
E.g.:

```
% The Graceful Restart command used is not valid at this moment.
zsh: exit 1     vtysh -c configure -c 'router bgp' -c 'no neighbor 127.0.0.1 graceful-restart
1
```

This does not make sense frr-reload to fail.

Instead, just ignore such requests if they are just NOOP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9ebdb8e80d83a9087deaffee93df4bc90ab6e7ee)

bgpd/bgpd.c

index a0b6cfb5008789aa6b888f14d176aa2f1787b940..f6854202db542b88b920be5cc4b5f9ad58c4c2ea 100644 (file)
@@ -1446,11 +1446,11 @@ int bgp_peer_gr_init(struct peer *peer)
        {
        /*      PEER_GLOBAL_INHERIT Mode        */
        /* Event-> */ /* PEER_GR_CMD */         /* NO_PEER_GR_CMD */
-               { PEER_GR, bgp_peer_gr_action }, { PEER_INVALID, NULL },
+               { PEER_GR, bgp_peer_gr_action }, { PEER_GLOBAL_INHERIT, NULL },
        /* Event-> */ /* PEER_DISABLE_CMD */     /* NO_PEER_DISABLE_CMD */
-               { PEER_DISABLE, bgp_peer_gr_action}, { PEER_INVALID, NULL },
+               { PEER_DISABLE, bgp_peer_gr_action }, { PEER_GLOBAL_INHERIT, NULL },
        /* Event-> */ /* PEER_HELPER_cmd */     /* NO_PEER_HELPER_CMD */
-               { PEER_HELPER, bgp_peer_gr_action }, { PEER_INVALID, NULL }
+               { PEER_HELPER, bgp_peer_gr_action }, { PEER_GLOBAL_INHERIT, NULL }
        }
        };
        memcpy(&peer->PEER_GR_FSM, local_Peer_GR_FSM,