diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-11-06 08:15:06 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-11-26 11:58:23 -0500 |
| commit | ba0edb9545038a8026813d5997a958cc6ed88765 (patch) | |
| tree | 2f9f07d171b5699ae608f5f0eea4ccc1a8ad23c3 /bgpd/bgp_fsm.c | |
| parent | 2e5b4e32c4d402bd547ba06ac2b797236e7eaea6 (diff) | |
bgpd: Add `peer_notify_config_change()` function
We have about a bajillion tests of if we can
notify the peer and then we send a config change
notification. Let's just make a function that
does this.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
| -rw-r--r-- | bgpd/bgp_fsm.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 490451f193..2cdbadc63c 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -2746,8 +2746,7 @@ static void bgp_gr_update_mode_of_all_peers(struct bgp *bgp, peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE; if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->connection->status)) - bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE, - BGP_NOTIFY_CEASE_CONFIG_CHANGE); + peer_notify_config_change(peer->connection); else bgp_session_reset_safe(peer, &nnode); } else { @@ -2769,8 +2768,7 @@ static void bgp_gr_update_mode_of_all_peers(struct bgp *bgp, member->last_reset = PEER_DOWN_CAPABILITY_CHANGE; if (BGP_IS_VALID_STATE_FOR_NOTIF(member->connection->status)) - bgp_notify_send(member->connection, BGP_NOTIFY_CEASE, - BGP_NOTIFY_CEASE_CONFIG_CHANGE); + peer_notify_config_change(member->connection); else bgp_session_reset(member); } @@ -2974,8 +2972,7 @@ unsigned int bgp_peer_gr_action(struct peer *peer, enum peer_mode old_state, peer->last_reset = PEER_DOWN_CAPABILITY_CHANGE; if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->connection->status)) - bgp_notify_send(peer->connection, BGP_NOTIFY_CEASE, - BGP_NOTIFY_CEASE_CONFIG_CHANGE); + peer_notify_config_change(peer->connection); else bgp_session_reset(peer); } else { @@ -2985,8 +2982,7 @@ unsigned int bgp_peer_gr_action(struct peer *peer, enum peer_mode old_state, bgp_peer_move_to_gr_mode(member, new_state); if (BGP_IS_VALID_STATE_FOR_NOTIF(member->connection->status)) - bgp_notify_send(member->connection, BGP_NOTIFY_CEASE, - BGP_NOTIFY_CEASE_CONFIG_CHANGE); + peer_notify_config_change(member->connection); else bgp_session_reset(member); } |
