diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-05-08 06:56:24 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-08 06:56:24 +0300 | 
| commit | 7472bc5bca99ebc5a62149e96b23053a1e2214b3 (patch) | |
| tree | 196b608c0a5f0d85aff7fd03732947a97b7b41f7 | |
| parent | 0b27a7d2faa7f4fcdb470a2c72388962709f7ed1 (diff) | |
| parent | 25986a7f5bf6b5b31c599aa48d2ff55bac439123 (diff) | |
Merge pull request #15951 from FRRouting/mergify/bp/stable/10.0/pr-15883
bgpd: Apply NOOP when doing negative commands for GR operations (backport #15883)
| -rw-r--r-- | bgpd/bgp_fsm.c | 17 | ||||
| -rw-r--r-- | bgpd/bgpd.c | 6 | 
2 files changed, 13 insertions, 10 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 234dbb0715..502648697c 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -2895,19 +2895,22 @@ int bgp_neighbor_graceful_restart(struct peer *peer,  	peer_old_state = bgp_peer_gr_mode_get(peer); -	if (peer_old_state == PEER_INVALID) { -		zlog_debug("[BGP_GR] peer_old_state == Invalid state !"); +	if (BGP_DEBUG(graceful_restart, GRACEFUL_RESTART)) +		zlog_debug("%s [BGP_GR] peer_old_state: %d", __func__, +			   peer_old_state); + +	if (peer_old_state == PEER_INVALID)  		return BGP_ERR_GR_OPERATION_FAILED; -	}  	peer_state = peer->PEER_GR_FSM[peer_old_state][peer_gr_cmd];  	peer_new_state = peer_state.next_state; -	if (peer_new_state == PEER_INVALID) { -		zlog_debug( -			"[BGP_GR] Invalid bgp graceful restart command used !"); +	if (BGP_DEBUG(graceful_restart, GRACEFUL_RESTART)) +		zlog_debug("%s [BGP_GR] peer_new_state: %d", __func__, +			   peer_new_state); + +	if (peer_new_state == PEER_INVALID)  		return BGP_ERR_GR_INVALID_CMD; -	}  	if (peer_new_state != peer_old_state) {  		result = peer_state.action_fun(peer, peer_old_state, 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,  | 
