mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 15:23:39 +00:00
bgpd: Convert bgp_fsm_nht_update to take a connection
Convert this function over to using a connection. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
7094cc7f42
commit
b57e023cc2
@ -66,7 +66,7 @@ static void bfd_session_status_update(struct bfd_session_params *bsp,
|
|||||||
if (bss->state == BSS_UP && bss->previous_state != BSS_UP &&
|
if (bss->state == BSS_UP && bss->previous_state != BSS_UP &&
|
||||||
!peer_established(peer->connection)) {
|
!peer_established(peer->connection)) {
|
||||||
if (!BGP_PEER_START_SUPPRESSED(peer)) {
|
if (!BGP_PEER_START_SUPPRESSED(peer)) {
|
||||||
bgp_fsm_nht_update(peer, true);
|
bgp_fsm_nht_update(peer->connection, peer, true);
|
||||||
BGP_EVENT_ADD(peer->connection, BGP_Start);
|
BGP_EVENT_ADD(peer->connection, BGP_Start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2372,27 +2372,27 @@ bgp_fsm_exception(struct peer_connection *connection)
|
|||||||
return bgp_stop(connection);
|
return bgp_stop(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops)
|
void bgp_fsm_nht_update(struct peer_connection *connection, struct peer *peer,
|
||||||
|
bool has_valid_nexthops)
|
||||||
{
|
{
|
||||||
if (!peer)
|
if (!peer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (peer->connection->status) {
|
switch (connection->status) {
|
||||||
case Idle:
|
case Idle:
|
||||||
if (has_valid_nexthops)
|
if (has_valid_nexthops)
|
||||||
BGP_EVENT_ADD(peer->connection, BGP_Start);
|
BGP_EVENT_ADD(connection, BGP_Start);
|
||||||
break;
|
break;
|
||||||
case Connect:
|
case Connect:
|
||||||
if (!has_valid_nexthops) {
|
if (!has_valid_nexthops) {
|
||||||
EVENT_OFF(peer->connection->t_connect);
|
EVENT_OFF(connection->t_connect);
|
||||||
BGP_EVENT_ADD(peer->connection, TCP_fatal_error);
|
BGP_EVENT_ADD(connection, TCP_fatal_error);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Active:
|
case Active:
|
||||||
if (has_valid_nexthops) {
|
if (has_valid_nexthops) {
|
||||||
EVENT_OFF(peer->connection->t_connect);
|
EVENT_OFF(connection->t_connect);
|
||||||
BGP_EVENT_ADD(peer->connection,
|
BGP_EVENT_ADD(connection, ConnectRetry_timer_expired);
|
||||||
ConnectRetry_timer_expired);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OpenSent:
|
case OpenSent:
|
||||||
@ -2401,7 +2401,7 @@ void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops)
|
|||||||
if (!has_valid_nexthops
|
if (!has_valid_nexthops
|
||||||
&& (peer->gtsm_hops == BGP_GTSM_HOPS_CONNECTED
|
&& (peer->gtsm_hops == BGP_GTSM_HOPS_CONNECTED
|
||||||
|| peer->bgp->fast_convergence))
|
|| peer->bgp->fast_convergence))
|
||||||
BGP_EVENT_ADD(peer->connection, TCP_fatal_error);
|
BGP_EVENT_ADD(connection, TCP_fatal_error);
|
||||||
case Clearing:
|
case Clearing:
|
||||||
case Deleted:
|
case Deleted:
|
||||||
case BGP_STATUS_MAX:
|
case BGP_STATUS_MAX:
|
||||||
|
@ -106,7 +106,8 @@ enum bgp_fsm_state_progress {
|
|||||||
/*
|
/*
|
||||||
* Update FSM for peer based on whether we have valid nexthops or not.
|
* Update FSM for peer based on whether we have valid nexthops or not.
|
||||||
*/
|
*/
|
||||||
extern void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops);
|
extern void bgp_fsm_nht_update(struct peer_connection *connection,
|
||||||
|
struct peer *peer, bool has_valid_nexthops);
|
||||||
extern void bgp_event(struct event *event);
|
extern void bgp_event(struct event *event);
|
||||||
extern int bgp_event_update(struct peer_connection *connection,
|
extern int bgp_event_update(struct peer_connection *connection,
|
||||||
enum bgp_fsm_events event);
|
enum bgp_fsm_events event);
|
||||||
|
@ -1407,7 +1407,8 @@ void evaluate_paths(struct bgp_nexthop_cache *bnc)
|
|||||||
__func__, peer->host,
|
__func__, peer->host,
|
||||||
peer->bgp->name_pretty,
|
peer->bgp->name_pretty,
|
||||||
!!valid_nexthops);
|
!!valid_nexthops);
|
||||||
bgp_fsm_nht_update(peer, !!valid_nexthops);
|
bgp_fsm_nht_update(peer->connection, peer,
|
||||||
|
!!valid_nexthops);
|
||||||
SET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
|
SET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user