if (bss->state == BSS_UP && bss->previous_state != BSS_UP &&
!peer_established(peer->connection)) {
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);
}
}
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)
return;
- switch (peer->connection->status) {
+ switch (connection->status) {
case Idle:
if (has_valid_nexthops)
- BGP_EVENT_ADD(peer->connection, BGP_Start);
+ BGP_EVENT_ADD(connection, BGP_Start);
break;
case Connect:
if (!has_valid_nexthops) {
- EVENT_OFF(peer->connection->t_connect);
- BGP_EVENT_ADD(peer->connection, TCP_fatal_error);
+ EVENT_OFF(connection->t_connect);
+ BGP_EVENT_ADD(connection, TCP_fatal_error);
}
break;
case Active:
if (has_valid_nexthops) {
- EVENT_OFF(peer->connection->t_connect);
- BGP_EVENT_ADD(peer->connection,
- ConnectRetry_timer_expired);
+ EVENT_OFF(connection->t_connect);
+ BGP_EVENT_ADD(connection, ConnectRetry_timer_expired);
}
break;
case OpenSent:
if (!has_valid_nexthops
&& (peer->gtsm_hops == BGP_GTSM_HOPS_CONNECTED
|| peer->bgp->fast_convergence))
- BGP_EVENT_ADD(peer->connection, TCP_fatal_error);
+ BGP_EVENT_ADD(connection, TCP_fatal_error);
case Clearing:
case Deleted:
case BGP_STATUS_MAX:
/*
* 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 int bgp_event_update(struct peer_connection *connection,
enum bgp_fsm_events event);
__func__, peer->host,
peer->bgp->name_pretty,
!!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);
}
}