bgpd: Print old/new states of graceful restart FSM

To better debug what's going on before/after.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-04-30 13:38:54 +03:00
parent 65c2593a12
commit 7b5595b61d

View File

@ -2915,19 +2915,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,