diff options
Diffstat (limited to 'ldpd/ldpe.c')
-rw-r--r-- | ldpd/ldpe.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c index 54bc09dad..451d637bc 100644 --- a/ldpd/ldpe.c +++ b/ldpd/ldpe.c @@ -119,8 +119,9 @@ ldpe(void) fatal(NULL); imsg_init(&iev_main->ibuf, LDPD_FD_ASYNC); iev_main->handler_read = ldpe_dispatch_main; - iev_main->ev_read = thread_add_read(master, iev_main->handler_read, - iev_main, iev_main->ibuf.fd); + iev_main->ev_read = NULL; + thread_add_read(master, iev_main->handler_read, iev_main, iev_main->ibuf.fd, + &iev_main->ev_read); iev_main->handler_write = ldp_write_handler; if ((iev_main_sync = calloc(1, sizeof(struct imsgev))) == NULL) @@ -159,9 +160,11 @@ ldpe_init(struct ldpd_init *init) fatal("inet_pton"); #ifdef __OpenBSD__ global.pfkeysock = pfkey_init(); - if (sysdep.no_pfkey == 0) - pfkey_ev = thread_add_read(master, ldpe_dispatch_pfkey, - NULL, global.pfkeysock); + if (sysdep.no_pfkey == 0) { + pfkey_ev = NULL; + thread_add_read(master, ldpe_dispatch_pfkey, NULL, global.pfkeysock, + &pfkey_ev); + } #endif /* mark sockets as closed */ @@ -348,8 +351,9 @@ ldpe_dispatch_main(struct thread *thread) fatal(NULL); imsg_init(&iev_lde->ibuf, fd); iev_lde->handler_read = ldpe_dispatch_lde; - iev_lde->ev_read = thread_add_read(master, - iev_lde->handler_read, iev_lde, iev_lde->ibuf.fd); + iev_lde->ev_read = NULL; + thread_add_read(master, iev_lde->handler_read, iev_lde, iev_lde->ibuf.fd, + &iev_lde->ev_read); iev_lde->handler_write = ldp_write_handler; iev_lde->ev_write = NULL; break; @@ -689,8 +693,9 @@ ldpe_dispatch_pfkey(struct thread *thread) { int fd = THREAD_FD(thread); - pfkey_ev = thread_add_read(master, ldpe_dispatch_pfkey, - NULL, global.pfkeysock); + pfkey_ev = NULL; + thread_add_read(master, ldpe_dispatch_pfkey, NULL, global.pfkeysock, + &pfkey_ev); if (pfkey_read(fd, NULL) == -1) fatal("pfkey_read failed, exiting..."); @@ -709,13 +714,15 @@ ldpe_setup_sockets(int af, int disc_socket, int edisc_socket, /* discovery socket */ af_global->ldp_disc_socket = disc_socket; - af_global->disc_ev = thread_add_read(master, disc_recv_packet, - &af_global->disc_ev, af_global->ldp_disc_socket); + af_global->disc_ev = NULL; + thread_add_read(master, disc_recv_packet, &af_global->disc_ev, af_global->ldp_disc_socket, + &af_global->disc_ev); /* extended discovery socket */ af_global->ldp_edisc_socket = edisc_socket; - af_global->edisc_ev = thread_add_read(master, disc_recv_packet, - &af_global->edisc_ev, af_global->ldp_edisc_socket); + af_global->edisc_ev = NULL; + thread_add_read(master, disc_recv_packet, &af_global->edisc_ev, af_global->ldp_edisc_socket, + &af_global->edisc_ev); /* session socket */ af_global->ldp_session_socket = session_socket; |