diff options
-rw-r--r-- | bgpd/bgp_fsm.c | 22 | ||||
-rw-r--r-- | bgpd/bgp_io.c | 10 | ||||
-rw-r--r-- | bgpd/bgpd.h | 5 |
3 files changed, 19 insertions, 18 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 706088333..1978d26cf 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -162,13 +162,13 @@ static struct peer *peer_xfer_conn(struct peer *from_peer) EVENT_OFF(peer->t_routeadv); EVENT_OFF(peer->connection->t_connect); EVENT_OFF(peer->connection->t_delayopen); - EVENT_OFF(peer->t_connect_check_r); - EVENT_OFF(peer->t_connect_check_w); + EVENT_OFF(peer->connection->t_connect_check_r); + EVENT_OFF(peer->connection->t_connect_check_w); EVENT_OFF(from_peer->t_routeadv); EVENT_OFF(from_peer->connection->t_connect); EVENT_OFF(from_peer->connection->t_delayopen); - EVENT_OFF(from_peer->t_connect_check_r); - EVENT_OFF(from_peer->t_connect_check_w); + EVENT_OFF(from_peer->connection->t_connect_check_r); + EVENT_OFF(from_peer->connection->t_connect_check_w); EVENT_OFF(from_peer->connection->t_process_packet); /* @@ -1509,8 +1509,8 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection) bgp_writes_off(connection); bgp_reads_off(connection); - EVENT_OFF(peer->t_connect_check_r); - EVENT_OFF(peer->t_connect_check_w); + EVENT_OFF(connection->t_connect_check_r); + EVENT_OFF(connection->t_connect_check_w); /* Stop all timers. */ EVENT_OFF(connection->t_start); @@ -1674,8 +1674,8 @@ static void bgp_connect_check(struct event *thread) assert(!peer->connection->t_read); assert(!peer->connection->t_write); - EVENT_OFF(peer->t_connect_check_r); - EVENT_OFF(peer->t_connect_check_w); + EVENT_OFF(peer->connection->t_connect_check_r); + EVENT_OFF(peer->connection->t_connect_check_w); /* Check file descriptor. */ slen = sizeof(status); @@ -1955,9 +1955,11 @@ static enum bgp_fsm_state_progress bgp_start(struct peer_connection *connection) * 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->connection->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->connection->t_connect_check_w); break; } return BGP_FSM_SUCCESS; diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c index 84e428cbc..55acc0ab8 100644 --- a/bgpd/bgp_io.c +++ b/bgpd/bgp_io.c @@ -45,7 +45,6 @@ static bool validate_header(struct peer_connection *connection); void bgp_writes_on(struct peer_connection *connection) { struct frr_pthread *fpt = bgp_pth_io; - struct peer *peer = connection->peer; assert(fpt->running); @@ -53,8 +52,8 @@ void bgp_writes_on(struct peer_connection *connection) assert(connection->obuf); assert(connection->ibuf); assert(connection->ibuf_work); - assert(!peer->t_connect_check_r); - assert(!peer->t_connect_check_w); + assert(!connection->t_connect_check_r); + assert(!connection->t_connect_check_w); assert(connection->fd); event_add_write(fpt->master, bgp_process_writes, connection, @@ -76,7 +75,6 @@ void bgp_writes_off(struct peer_connection *connection) void bgp_reads_on(struct peer_connection *connection) { - struct peer *peer = connection->peer; struct frr_pthread *fpt = bgp_pth_io; assert(fpt->running); @@ -85,8 +83,8 @@ void bgp_reads_on(struct peer_connection *connection) assert(connection->fd); assert(connection->ibuf_work); assert(connection->obuf); - assert(!peer->t_connect_check_r); - assert(!peer->t_connect_check_w); + assert(!connection->t_connect_check_r); + assert(!connection->t_connect_check_w); assert(connection->fd); event_add_read(fpt->master, bgp_process_reads, connection, diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index b68260799..4b1029778 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1143,6 +1143,9 @@ struct peer_connection { struct event *t_start; struct event *t_holdtime; + struct event *t_connect_check_r; + struct event *t_connect_check_w; + struct event *t_process_packet; struct event *t_process_packet_error; @@ -1552,8 +1555,6 @@ struct peer { _Atomic uint32_t v_gr_restart; /* Threads. */ - struct event *t_connect_check_r; - struct event *t_connect_check_w; struct event *t_routeadv; struct event *t_pmax_restart; struct event *t_gr_restart; |