summaryrefslogtreecommitdiff
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-08-09 23:43:46 -0400
committerDonald Sharp <sharpd@nvidia.com>2023-08-18 09:29:04 -0400
commit3e5a31b24ee6a3bdcc478fa9c842c5d1b69cd067 (patch)
tree7840d5c40b49d7ee03c461cdcd9ec0b32aa25f28 /bgpd/bgp_fsm.c
parent5d527567357ed859eeb01062777f2c313ee08da2 (diff)
bgpd: Convert `struct peer_connection` to dynamically allocated
As part of the conversion to a `struct peer_connection` it will be desirable to have 2 pointers one for when we open a connection and one for when we receive a connection. Start this actual conversion over to this in `struct peer`. If this sounds confusing take a look at the bgp state machine for connections and how it resolves the processing of this router opening -vs- this router receiving an open. At some point in time the state machine decides that we are keeping one of the two connections. Future commits will allow us to untangle the peer/doppelganger duality with this abstraction. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c224
1 files changed, 112 insertions, 112 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 41d386ebaa..ec1387cc96 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -146,13 +146,13 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s: peer transfer %p fd %d -> %p fd %d)",
- from_peer->host, from_peer, from_peer->connection.fd,
- peer, peer->connection.fd);
+ from_peer->host, from_peer, from_peer->connection->fd,
+ peer, peer->connection->fd);
- bgp_writes_off(&peer->connection);
- bgp_reads_off(&peer->connection);
- bgp_writes_off(&from_peer->connection);
- bgp_reads_off(&from_peer->connection);
+ bgp_writes_off(peer->connection);
+ bgp_reads_off(peer->connection);
+ bgp_writes_off(from_peer->connection);
+ bgp_reads_off(from_peer->connection);
/*
* Before exchanging FD remove doppelganger from
@@ -172,21 +172,21 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
EVENT_OFF(from_peer->t_delayopen);
EVENT_OFF(from_peer->t_connect_check_r);
EVENT_OFF(from_peer->t_connect_check_w);
- EVENT_OFF(from_peer->connection.t_process_packet);
+ EVENT_OFF(from_peer->connection->t_process_packet);
/*
* At this point in time, it is possible that there are packets pending
* on various buffers. Those need to be transferred or dropped,
* otherwise we'll get spurious failures during session establishment.
*/
- frr_with_mutex (&peer->connection.io_mtx,
- &from_peer->connection.io_mtx) {
- fd = peer->connection.fd;
- peer->connection.fd = from_peer->connection.fd;
- from_peer->connection.fd = fd;
+ frr_with_mutex (&peer->connection->io_mtx,
+ &from_peer->connection->io_mtx) {
+ fd = peer->connection->fd;
+ peer->connection->fd = from_peer->connection->fd;
+ from_peer->connection->fd = fd;
- stream_fifo_clean(peer->connection.ibuf);
- stream_fifo_clean(peer->connection.obuf);
+ stream_fifo_clean(peer->connection->ibuf);
+ stream_fifo_clean(peer->connection->obuf);
/*
* this should never happen, since bgp_process_packet() is the
@@ -208,21 +208,21 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
}
// copy each packet from old peer's output queue to new peer
- while (from_peer->connection.obuf->head)
- stream_fifo_push(peer->connection.obuf,
+ while (from_peer->connection->obuf->head)
+ stream_fifo_push(peer->connection->obuf,
stream_fifo_pop(
- from_peer->connection.obuf));
+ from_peer->connection->obuf));
// copy each packet from old peer's input queue to new peer
- while (from_peer->connection.ibuf->head)
- stream_fifo_push(peer->connection.ibuf,
+ while (from_peer->connection->ibuf->head)
+ stream_fifo_push(peer->connection->ibuf,
stream_fifo_pop(
- from_peer->connection.ibuf));
+ from_peer->connection->ibuf));
- ringbuf_wipe(peer->connection.ibuf_work);
- ringbuf_copy(peer->connection.ibuf_work,
- from_peer->connection.ibuf_work,
- ringbuf_remain(from_peer->connection.ibuf_work));
+ ringbuf_wipe(peer->connection->ibuf_work);
+ ringbuf_copy(peer->connection->ibuf_work,
+ from_peer->connection->ibuf_work,
+ ringbuf_remain(from_peer->connection->ibuf_work));
}
peer->as = from_peer->as;
@@ -233,16 +233,16 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
peer->v_gr_restart = from_peer->v_gr_restart;
peer->cap = from_peer->cap;
peer->remote_role = from_peer->remote_role;
- status = peer->connection.status;
- pstatus = peer->connection.ostatus;
+ status = peer->connection->status;
+ pstatus = peer->connection->ostatus;
last_evt = peer->last_event;
last_maj_evt = peer->last_major_event;
- peer->connection.status = from_peer->connection.status;
- peer->connection.ostatus = from_peer->connection.ostatus;
+ peer->connection->status = from_peer->connection->status;
+ peer->connection->ostatus = from_peer->connection->ostatus;
peer->last_event = from_peer->last_event;
peer->last_major_event = from_peer->last_major_event;
- from_peer->connection.status = status;
- from_peer->connection.ostatus = pstatus;
+ from_peer->connection->status = status;
+ from_peer->connection->ostatus = pstatus;
from_peer->last_event = last_evt;
from_peer->last_major_event = last_maj_evt;
peer->remote_id = from_peer->remote_id;
@@ -304,13 +304,13 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
(CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER)
? "accept"
: ""),
- peer->host, peer->connection.fd,
- from_peer->connection.fd);
+ peer->host, peer->connection->fd,
+ from_peer->connection->fd);
BGP_EVENT_ADD(peer, BGP_Stop);
BGP_EVENT_ADD(from_peer, BGP_Stop);
return NULL;
}
- if (from_peer->connection.status > Active) {
+ if (from_peer->connection->status > Active) {
if (bgp_getsockname(from_peer) < 0) {
flog_err(EC_LIB_SOCKET,
"%%bgp_getsockname() failed for %s from_peer %s fd %d (peer fd %d)",
@@ -319,8 +319,8 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
PEER_STATUS_ACCEPT_PEER)
? "accept"
: ""),
- from_peer->host, from_peer->connection.fd,
- peer->connection.fd);
+ from_peer->host, from_peer->connection->fd,
+ peer->connection->fd);
bgp_stop(from_peer);
from_peer = NULL;
}
@@ -338,10 +338,10 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
if (from_peer)
bgp_replace_nexthop_by_peer(from_peer, peer);
- bgp_reads_on(&peer->connection);
- bgp_writes_on(&peer->connection);
- event_add_event(bm->master, bgp_process_packet, &peer->connection, 0,
- &peer->connection.t_process_packet);
+ bgp_reads_on(peer->connection);
+ bgp_writes_on(peer->connection);
+ event_add_event(bm->master, bgp_process_packet, peer->connection, 0,
+ &peer->connection->t_process_packet);
return (peer);
}
@@ -354,7 +354,7 @@ void bgp_timer_set(struct peer *peer)
afi_t afi;
safi_t safi;
- switch (peer->connection.status) {
+ switch (peer->connection->status) {
case Idle:
/* First entry point of peer's finite state machine. In Idle
status start timer is on unless peer is shutdown or peer is
@@ -522,8 +522,8 @@ static void bgp_connect_timer(struct event *thread)
/* stop the DelayOpenTimer if it is running */
EVENT_OFF(peer->t_delayopen);
- assert(!peer->connection.t_write);
- assert(!peer->connection.t_read);
+ assert(!peer->connection->t_write);
+ assert(!peer->connection->t_read);
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s [FSM] Timer (connect timer expire)", peer->host);
@@ -558,7 +558,7 @@ static void bgp_holdtime_timer(struct event *thread)
* for systems where we are heavily loaded for one
* reason or another.
*/
- inq_count = atomic_load_explicit(&peer->connection.ibuf->count,
+ inq_count = atomic_load_explicit(&peer->connection->ibuf->count,
memory_order_relaxed);
if (inq_count)
BGP_TIMER_ON(peer->t_holdtime, bgp_holdtime_timer,
@@ -1225,7 +1225,7 @@ static void bgp_update_delay_process_status_change(struct peer *peer)
if (CHECK_FLAG(peer->cap, PEER_CAP_GRACEFUL_RESTART_R_BIT_RCV))
bgp_update_restarted_peers(peer);
}
- if (peer->connection.ostatus == Established &&
+ if (peer->connection->ostatus == Established &&
bgp_update_delay_active(peer->bgp)) {
/* Adjust the update-delay state to account for this flap.
NOTE: Intentionally skipping adjusting implicit_eors or
@@ -1302,15 +1302,15 @@ void bgp_fsm_change_status(struct peer *peer, enum bgp_fsm_status status)
}
/* Preserve old status and change into new status. */
- peer->connection.ostatus = peer->connection.status;
- peer->connection.status = status;
+ peer->connection->ostatus = peer->connection->status;
+ peer->connection->status = status;
/* Reset received keepalives counter on every FSM change */
peer->rtt_keepalive_rcv = 0;
/* Fire backward transition hook if that's the case */
- if (peer->connection.ostatus == Established &&
- peer->connection.status != Established)
+ if (peer->connection->ostatus == Established &&
+ peer->connection->status != Established)
hook_call(peer_backward_transition, peer);
/* Save event that caused status change. */
@@ -1338,10 +1338,10 @@ void bgp_fsm_change_status(struct peer *peer, enum bgp_fsm_status status)
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s fd %d went from %s to %s", peer->host,
- peer->connection.fd,
- lookup_msg(bgp_status_msg, peer->connection.ostatus,
+ peer->connection->fd,
+ lookup_msg(bgp_status_msg, peer->connection->ostatus,
NULL),
- lookup_msg(bgp_status_msg, peer->connection.status,
+ lookup_msg(bgp_status_msg, peer->connection->status,
NULL));
}
@@ -1384,7 +1384,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer *peer)
}
/* Can't do this in Clearing; events are used for state transitions */
- if (peer->connection.status != Clearing) {
+ if (peer->connection->status != Clearing) {
/* Delete all existing events of the peer */
BGP_EVENT_FLUSH(peer);
}
@@ -1503,8 +1503,8 @@ enum bgp_fsm_state_progress bgp_stop(struct peer *peer)
bgp_keepalives_off(peer);
/* Stop read and write threads. */
- bgp_writes_off(&peer->connection);
- bgp_reads_off(&peer->connection);
+ bgp_writes_off(peer->connection);
+ bgp_reads_off(peer->connection);
EVENT_OFF(peer->t_connect_check_r);
EVENT_OFF(peer->t_connect_check_w);
@@ -1517,14 +1517,14 @@ enum bgp_fsm_state_progress bgp_stop(struct peer *peer)
EVENT_OFF(peer->t_delayopen);
/* Clear input and output buffer. */
- frr_with_mutex (&peer->connection.io_mtx) {
- if (peer->connection.ibuf)
- stream_fifo_clean(peer->connection.ibuf);
- if (peer->connection.obuf)
- stream_fifo_clean(peer->connection.obuf);
+ frr_with_mutex (&peer->connection->io_mtx) {
+ if (peer->connection->ibuf)
+ stream_fifo_clean(peer->connection->ibuf);
+ if (peer->connection->obuf)
+ stream_fifo_clean(peer->connection->obuf);
- if (peer->connection.ibuf_work)
- ringbuf_wipe(peer->connection.ibuf_work);
+ if (peer->connection->ibuf_work)
+ ringbuf_wipe(peer->connection->ibuf_work);
if (peer->curr) {
stream_free(peer->curr);
@@ -1533,9 +1533,9 @@ enum bgp_fsm_state_progress bgp_stop(struct peer *peer)
}
/* Close of file descriptor. */
- if (peer->connection.fd >= 0) {
- close(peer->connection.fd);
- peer->connection.fd = -1;
+ if (peer->connection->fd >= 0) {
+ close(peer->connection->fd);
+ peer->connection->fd = -1;
}
/* Reset capabilities. */
@@ -1559,7 +1559,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer *peer)
/* Received ORF prefix-filter */
peer->orf_plist[afi][safi] = NULL;
- if ((peer->connection.status == OpenConfirm) ||
+ if ((peer->connection->status == OpenConfirm) ||
peer_established(peer)) {
/* ORF received prefix-filter pnt */
snprintf(orf_name, sizeof(orf_name), "%s.%d.%d",
@@ -1661,19 +1661,19 @@ static void bgp_connect_check(struct event *thread)
struct peer *peer;
peer = EVENT_ARG(thread);
- assert(!CHECK_FLAG(peer->connection.thread_flags,
+ assert(!CHECK_FLAG(peer->connection->thread_flags,
PEER_THREAD_READS_ON));
- assert(!CHECK_FLAG(peer->connection.thread_flags,
+ assert(!CHECK_FLAG(peer->connection->thread_flags,
PEER_THREAD_WRITES_ON));
- assert(!peer->connection.t_read);
- assert(!peer->connection.t_write);
+ assert(!peer->connection->t_read);
+ assert(!peer->connection->t_write);
EVENT_OFF(peer->t_connect_check_r);
EVENT_OFF(peer->t_connect_check_w);
/* Check file descriptor. */
slen = sizeof(status);
- ret = getsockopt(peer->connection.fd, SOL_SOCKET, SO_ERROR,
+ ret = getsockopt(peer->connection->fd, SOL_SOCKET, SO_ERROR,
(void *)&status, &slen);
/* If getsockopt is fail, this is fatal error. */
@@ -1704,19 +1704,19 @@ static void bgp_connect_check(struct event *thread)
add read thread for reading open message. */
static enum bgp_fsm_state_progress bgp_connect_success(struct peer *peer)
{
- if (peer->connection.fd < 0) {
+ if (peer->connection->fd < 0) {
flog_err(EC_BGP_CONNECT, "%s peer's fd is negative value %d",
- __func__, peer->connection.fd);
+ __func__, peer->connection->fd);
return bgp_stop(peer);
}
if (bgp_getsockname(peer) < 0) {
flog_err_sys(EC_LIB_SOCKET,
"%s: bgp_getsockname(): failed for peer %s, fd %d",
- __func__, peer->host, peer->connection.fd);
+ __func__, peer->host, peer->connection->fd);
bgp_notify_send(peer, BGP_NOTIFY_FSM_ERR,
- bgp_fsm_error_subcode(peer->connection.status));
- bgp_writes_on(&peer->connection);
+ bgp_fsm_error_subcode(peer->connection->status));
+ bgp_writes_on(peer->connection);
return BGP_FSM_FAILURE;
}
@@ -1726,7 +1726,7 @@ static enum bgp_fsm_state_progress bgp_connect_success(struct peer *peer)
*/
bgp_nht_interface_events(peer);
- bgp_reads_on(&peer->connection);
+ bgp_reads_on(peer->connection);
if (bgp_debug_neighbor_events(peer)) {
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
@@ -1748,19 +1748,19 @@ static enum bgp_fsm_state_progress bgp_connect_success(struct peer *peer)
static enum bgp_fsm_state_progress
bgp_connect_success_w_delayopen(struct peer *peer)
{
- if (peer->connection.fd < 0) {
+ if (peer->connection->fd < 0) {
flog_err(EC_BGP_CONNECT, "%s: peer's fd is negative value %d",
- __func__, peer->connection.fd);
+ __func__, peer->connection->fd);
return bgp_stop(peer);
}
if (bgp_getsockname(peer) < 0) {
flog_err_sys(EC_LIB_SOCKET,
"%s: bgp_getsockname(): failed for peer %s, fd %d",
- __func__, peer->host, peer->connection.fd);
+ __func__, peer->host, peer->connection->fd);
bgp_notify_send(peer, BGP_NOTIFY_FSM_ERR,
- bgp_fsm_error_subcode(peer->connection.status));
- bgp_writes_on(&peer->connection);
+ bgp_fsm_error_subcode(peer->connection->status));
+ bgp_writes_on(peer->connection);
return BGP_FSM_FAILURE;
}
@@ -1770,7 +1770,7 @@ bgp_connect_success_w_delayopen(struct peer *peer)
*/
bgp_nht_interface_events(peer);
- bgp_reads_on(&peer->connection);
+ bgp_reads_on(peer->connection);
if (bgp_debug_neighbor_events(peer)) {
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
@@ -1900,11 +1900,11 @@ enum bgp_fsm_state_progress bgp_start(struct peer *peer)
}
}
- assert(!peer->connection.t_write);
- assert(!peer->connection.t_read);
- assert(!CHECK_FLAG(peer->connection.thread_flags,
+ assert(!peer->connection->t_write);
+ assert(!peer->connection->t_read);
+ assert(!CHECK_FLAG(peer->connection->thread_flags,
PEER_THREAD_WRITES_ON));
- assert(!CHECK_FLAG(peer->connection.thread_flags,
+ assert(!CHECK_FLAG(peer->connection->thread_flags,
PEER_THREAD_READS_ON));
status = bgp_connect(peer);
@@ -1917,7 +1917,7 @@ enum bgp_fsm_state_progress bgp_start(struct peer *peer)
case connect_success:
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s [FSM] Connect immediately success, fd %d",
- peer->host, peer->connection.fd);
+ peer->host, peer->connection->fd);
BGP_EVENT_ADD(peer, TCP_connection_open);
break;
@@ -1926,10 +1926,10 @@ enum bgp_fsm_state_progress bgp_start(struct peer *peer)
readable or writable. */
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s [FSM] Non blocking connect waiting result, fd %d",
- peer->host, peer->connection.fd);
- if (peer->connection.fd < 0) {
+ peer->host, peer->connection->fd);
+ if (peer->connection->fd < 0) {
flog_err(EC_BGP_FSM, "%s peer's fd is negative value %d",
- __func__, peer->connection.fd);
+ __func__, peer->connection->fd);
return BGP_FSM_FAILURE;
}
/*
@@ -1942,9 +1942,9 @@ enum bgp_fsm_state_progress bgp_start(struct peer *peer)
* unused event in that function.
*/
event_add_read(bm->master, bgp_connect_check, peer,
- peer->connection.fd, &peer->t_connect_check_r);
+ peer->connection->fd, &peer->t_connect_check_r);
event_add_write(bm->master, bgp_connect_check, peer,
- peer->connection.fd, &peer->t_connect_check_w);
+ peer->connection->fd, &peer->t_connect_check_w);
break;
}
return BGP_FSM_SUCCESS;
@@ -1969,8 +1969,8 @@ static enum bgp_fsm_state_progress bgp_reconnect(struct peer *peer)
static enum bgp_fsm_state_progress bgp_fsm_open(struct peer *peer)
{
/* If DelayOpen is active, we may still need to send an open message */
- if ((peer->connection.status == Connect) ||
- (peer->connection.status == Active))
+ if ((peer->connection->status == Connect) ||
+ (peer->connection->status == Active))
bgp_open_send(peer);
/* Send keepalive and make keepalive timer */
@@ -1985,11 +1985,11 @@ static enum bgp_fsm_state_progress bgp_fsm_event_error(struct peer *peer)
{
flog_err(EC_BGP_FSM, "%s [FSM] unexpected packet received in state %s",
peer->host,
- lookup_msg(bgp_status_msg, peer->connection.status, NULL));
+ lookup_msg(bgp_status_msg, peer->connection->status, NULL));
return bgp_stop_with_notify(peer, BGP_NOTIFY_FSM_ERR,
bgp_fsm_error_subcode(
- peer->connection.status));
+ peer->connection->status));
}
/* Hold timer expire. This is error of BGP connection. So cut the
@@ -2296,13 +2296,13 @@ static enum bgp_fsm_state_progress bgp_establish(struct peer *peer)
}
if (peer->doppelganger &&
- (peer->doppelganger->connection.status != Deleted)) {
+ (peer->doppelganger->connection->status != Deleted)) {
if (bgp_debug_neighbor_events(peer))
zlog_debug(
"[Event] Deleting stub connection for peer %s",
peer->host);
- if (peer->doppelganger->connection.status > Active)
+ if (peer->doppelganger->connection->status > Active)
bgp_notify_send(peer->doppelganger, BGP_NOTIFY_CEASE,
BGP_NOTIFY_CEASE_COLLISION_RESOLUTION);
else
@@ -2344,9 +2344,9 @@ static enum bgp_fsm_state_progress bgp_ignore(struct peer *peer)
flog_err(EC_BGP_FSM,
"%s [FSM] Ignoring event %s in state %s, prior events %s, %s, fd %d",
peer->host, bgp_event_str[peer->cur_event],
- lookup_msg(bgp_status_msg, peer->connection.status, NULL),
+ lookup_msg(bgp_status_msg, peer->connection->status, NULL),
bgp_event_str[peer->last_event],
- bgp_event_str[peer->last_major_event], peer->connection.fd);
+ bgp_event_str[peer->last_major_event], peer->connection->fd);
return BGP_FSM_SUCCESS;
}
@@ -2356,9 +2356,9 @@ static enum bgp_fsm_state_progress bgp_fsm_exception(struct peer *peer)
flog_err(EC_BGP_FSM,
"%s [FSM] Unexpected event %s in state %s, prior events %s, %s, fd %d",
peer->host, bgp_event_str[peer->cur_event],
- lookup_msg(bgp_status_msg, peer->connection.status, NULL),
+ lookup_msg(bgp_status_msg, peer->connection->status, NULL),
bgp_event_str[peer->last_event],
- bgp_event_str[peer->last_major_event], peer->connection.fd);
+ bgp_event_str[peer->last_major_event], peer->connection->fd);
return bgp_stop(peer);
}
@@ -2367,7 +2367,7 @@ void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops)
if (!peer)
return;
- switch (peer->connection.status) {
+ switch (peer->connection->status) {
case Idle:
if (has_valid_nexthops)
BGP_EVENT_ADD(peer, BGP_Start);
@@ -2596,22 +2596,22 @@ int bgp_event_update(struct peer *peer, enum bgp_fsm_events event)
dyn_nbr = peer_dynamic_neighbor(peer);
/* Logging this event. */
- next = FSM[peer->connection.status - 1][event - 1].next_state;
+ next = FSM[peer->connection->status - 1][event - 1].next_state;
- if (bgp_debug_neighbor_events(peer) && peer->connection.status != next)
+ if (bgp_debug_neighbor_events(peer) && peer->connection->status != next)
zlog_debug("%s [FSM] %s (%s->%s), fd %d", peer->host,
bgp_event_str[event],
- lookup_msg(bgp_status_msg, peer->connection.status,
+ lookup_msg(bgp_status_msg, peer->connection->status,
NULL),
lookup_msg(bgp_status_msg, next, NULL),
- peer->connection.fd);
+ peer->connection->fd);
peer->last_event = peer->cur_event;
peer->cur_event = event;
/* Call function. */
- if (FSM[peer->connection.status - 1][event - 1].func)
- ret = (*(FSM[peer->connection.status - 1][event - 1].func))(
+ if (FSM[peer->connection->status - 1][event - 1].func)
+ ret = (*(FSM[peer->connection->status - 1][event - 1].func))(
peer);
if (ret >= BGP_FSM_SUCCESS) {
@@ -2625,7 +2625,7 @@ int bgp_event_update(struct peer *peer, enum bgp_fsm_events event)
}
/* If status is changed. */
- if (next != peer->connection.status) {
+ if (next != peer->connection->status) {
bgp_fsm_change_status(peer, next);
/*
@@ -2656,10 +2656,10 @@ int bgp_event_update(struct peer *peer, enum bgp_fsm_events event)
"%s [FSM] Failure handling event %s in state %s, prior events %s, %s, fd %d, last reset: %s",
peer->host, bgp_event_str[peer->cur_event],
lookup_msg(bgp_status_msg,
- peer->connection.status, NULL),
+ peer->connection->status, NULL),
bgp_event_str[peer->last_event],
bgp_event_str[peer->last_major_event],
- peer->connection.fd,
+ peer->connection->fd,
peer_down_str[peer->last_reset]);
bgp_stop(peer);
bgp_fsm_change_status(peer, Idle);