summaryrefslogtreecommitdiff
path: root/bgpd/bgp_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_io.c')
-rw-r--r--bgpd/bgp_io.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c
index 729a8fe299..dac915a73d 100644
--- a/bgpd/bgp_io.c
+++ b/bgpd/bgp_io.c
@@ -99,7 +99,11 @@ void bgp_reads_off(struct peer_connection *connection)
assert(fpt->running);
event_cancel_async(fpt->master, &connection->t_read, NULL);
- EVENT_OFF(connection->t_process_packet);
+
+ frr_with_mutex (&bm->peer_connection_mtx) {
+ if (peer_connection_fifo_member(&bm->connection_fifo, connection))
+ peer_connection_fifo_del(&bm->connection_fifo, connection);
+ }
UNSET_FLAG(connection->thread_flags, PEER_THREAD_READS_ON);
}
@@ -292,9 +296,13 @@ done:
event_add_read(fpt->master, bgp_process_reads, connection,
connection->fd, &connection->t_read);
- if (added_pkt)
- event_add_event(bm->master, bgp_process_packet, connection, 0,
- &connection->t_process_packet);
+ if (added_pkt) {
+ frr_with_mutex (&bm->peer_connection_mtx) {
+ if (!peer_connection_fifo_member(&bm->connection_fifo, connection))
+ peer_connection_fifo_add_tail(&bm->connection_fifo, connection);
+ }
+ event_add_event(bm->master, bgp_process_packet, NULL, 0, &bm->e_process_packet);
+ }
}
/*