Skip to content

Commit

Permalink
bgpd: Ignore peer GR commands that are effectively not operable
Browse files Browse the repository at this point in the history
The code used to treat a repeated GR configuration on a peer or some
other inappropriate command (e.g., trying to remove 'helper' configuration
when it is not present) as errors. Instead, just ignore these. This is
more in line with other behavior.

Signed-off-by: Vivek Venkatraman <[email protected]>

Ticket: #2736244, #2736249
Testing Done:
1. Manual testing - documented in the RM tickets
2. Precommit - user job #15 - 1 failure seen is existing failure
  • Loading branch information
vivek-cumulus authored and donaldsharp committed Feb 9, 2023
1 parent 2839c52 commit 7de5d61
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bgpd/bgp_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,11 @@ int bgp_gr_update_all(struct bgp *bgp, int global_gr_cmd)
"%s [BGP_GR] global_new_state == global_old_state :%s",
__func__,
print_global_gr_mode(global_new_state));
return BGP_GR_NO_OPERATION;
/* Next state 'invalid' is actually an 'ignore' */
if (global_new_state == GLOBAL_INVALID)
return BGP_GR_NO_OPERATION;

return BGP_GR_NO_OPERATION;
}

return bgp_gr_lookup_n_update_all_peer(bgp, global_new_state,
Expand Down Expand Up @@ -2892,6 +2896,10 @@ int bgp_neighbor_graceful_restart(struct peer *peer, int peer_gr_cmd)
return BGP_ERR_GR_INVALID_CMD;
}

/* Next state 'invalid' is actually an 'ignore' */
if (peer_new_state == PEER_INVALID)
return BGP_GR_NO_OPERATION;

if (peer_new_state != peer_old_state) {
result = peer_state.action_fun(peer, peer_old_state,
peer_new_state);
Expand Down Expand Up @@ -2940,6 +2948,9 @@ unsigned int bgp_peer_gr_action(struct peer *peer, int old_peer_state,
return BGP_ERR_GR_INVALID_CMD;
}

if (new_peer_state == PEER_INVALID)
return BGP_GR_NO_OPERATION;

bgp_gr_global_mode = bgp_global_gr_mode_get(peer->bgp);

if ((old_peer_state == PEER_GLOBAL_INHERIT)
Expand Down

0 comments on commit 7de5d61

Please sign in to comment.