Skip to content

Commit add373f

Browse files
vivek-cumulusdonaldsharp
authored andcommitted
bgpd: Ignore peer GR commands that are effectively not operable
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
1 parent 314510f commit add373f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

bgpd/bgp_fsm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,11 @@ int bgp_gr_update_all(struct bgp *bgp, int global_gr_cmd)
27442744
"%s [BGP_GR] global_new_state == global_old_state :%s",
27452745
__func__,
27462746
print_global_gr_mode(global_new_state));
2747-
return BGP_GR_NO_OPERATION;
2747+
/* Next state 'invalid' is actually an 'ignore' */
2748+
if (global_new_state == GLOBAL_INVALID)
2749+
return BGP_GR_NO_OPERATION;
2750+
2751+
return BGP_GR_NO_OPERATION;
27482752
}
27492753

27502754
return bgp_gr_lookup_n_update_all_peer(bgp, global_new_state,
@@ -2892,6 +2896,10 @@ int bgp_neighbor_graceful_restart(struct peer *peer, int peer_gr_cmd)
28922896
return BGP_ERR_GR_INVALID_CMD;
28932897
}
28942898

2899+
/* Next state 'invalid' is actually an 'ignore' */
2900+
if (peer_new_state == PEER_INVALID)
2901+
return BGP_GR_NO_OPERATION;
2902+
28952903
if (peer_new_state != peer_old_state) {
28962904
result = peer_state.action_fun(peer, peer_old_state,
28972905
peer_new_state);
@@ -2940,6 +2948,9 @@ unsigned int bgp_peer_gr_action(struct peer *peer, int old_peer_state,
29402948
return BGP_ERR_GR_INVALID_CMD;
29412949
}
29422950

2951+
if (new_peer_state == PEER_INVALID)
2952+
return BGP_GR_NO_OPERATION;
2953+
29432954
bgp_gr_global_mode = bgp_global_gr_mode_get(peer->bgp);
29442955

29452956
if ((old_peer_state == PEER_GLOBAL_INHERIT)

0 commit comments

Comments
 (0)