/* something went wrong, send notify and tear down */
static enum bgp_fsm_state_progress
-bgp_stop_with_notify(struct peer *peer, uint8_t code, uint8_t sub_code)
+bgp_stop_with_notify(struct peer_connection *connection, uint8_t code,
+ uint8_t sub_code)
{
+ struct peer *peer = connection->peer;
+
/* Send notify to remote peer */
- bgp_notify_send(peer->connection, code, sub_code);
+ bgp_notify_send(connection, code, sub_code);
if (peer_dynamic_neighbor_no_nsf(peer)) {
if (bgp_debug_neighbor_events(peer))
/* Clear start timer value to default. */
peer->v_start = BGP_INIT_START_TIMER;
- return bgp_stop(peer->connection);
+ return bgp_stop(connection);
}
/**
peer->host,
lookup_msg(bgp_status_msg, connection->status, NULL));
- return bgp_stop_with_notify(peer, BGP_NOTIFY_FSM_ERR,
+ return bgp_stop_with_notify(connection, BGP_NOTIFY_FSM_ERR,
bgp_fsm_error_subcode(connection->status));
}
if (CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_MODE))
SET_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT);
- return bgp_stop_with_notify(peer, BGP_NOTIFY_HOLD_ERR, 0);
+ return bgp_stop_with_notify(connection, BGP_NOTIFY_HOLD_ERR, 0);
}
/* RFC 4271 DelayOpenTimer_Expires event */