From 25986a7f5bf6b5b31c599aa48d2ff55bac439123 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 30 Apr 2024 13:40:08 +0300 Subject: [PATCH] bgpd: Apply NOOP when doing negative commands for GR operations 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 (cherry picked from commit 9ebdb8e80d83a9087deaffee93df4bc90ab6e7ee) --- bgpd/bgpd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index a0b6cfb500..f6854202db 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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, -- 2.39.5