/* forward declarations */
static uint16_t bgp_write(struct peer *);
static uint16_t bgp_read(struct peer *peer, int *code_p);
-static int bgp_process_writes(struct thread *);
-static int bgp_process_reads(struct thread *);
+static void bgp_process_writes(struct thread *);
+static void bgp_process_reads(struct thread *);
static bool validate_header(struct peer *);
/* generic i/o status codes */
thread_cancel_async(fpt->master, &peer->t_read, NULL);
THREAD_OFF(peer->t_process_packet);
+ THREAD_OFF(peer->t_process_packet_error);
UNSET_FLAG(peer->thread_flags, PEER_THREAD_READS_ON);
}
/*
* Called from I/O pthread when a file descriptor has become ready for writing.
*/
-static int bgp_process_writes(struct thread *thread)
+static void bgp_process_writes(struct thread *thread)
{
static struct peer *peer;
peer = THREAD_ARG(thread);
bool fatal = false;
if (peer->fd < 0)
- return -1;
+ return;
struct frr_pthread *fpt = bgp_pth_io;
BGP_UPDATE_GROUP_TIMER_ON(&peer->t_generate_updgrp_packets,
bgp_generate_updgrp_packets);
}
-
- return 0;
}
/*
* We read as much data as possible, process as many packets as we can and
* place them on peer->ibuf for secondary processing by the main thread.
*/
-static int bgp_process_reads(struct thread *thread)
+static void bgp_process_reads(struct thread *thread)
{
/* clang-format off */
static struct peer *peer; // peer to read from
peer = THREAD_ARG(thread);
if (peer->fd < 0 || bm->terminating)
- return -1;
+ return;
struct frr_pthread *fpt = bgp_pth_io;
* specific state change from 'bgp_read'.
*/
thread_add_event(bm->master, bgp_packet_process_error,
- peer, code, NULL);
+ peer, code, &peer->t_process_packet_error);
}
while (more) {
thread_add_event(bm->master, bgp_process_packet,
peer, 0, &peer->t_process_packet);
}
-
- return 0;
}
/*