]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/accept.c
Merge pull request #3405 from LabNConsulting/working/master/fix-vrf
[mirror_frr.git] / ldpd / accept.c
index 4cb461b9088686bed4126b0f23f965132b74eb01..323558d7fd2581b6bb0a1e6f67294656115eaee6 100644 (file)
@@ -58,7 +58,8 @@ accept_add(int fd, int (*cb)(struct thread *), void *arg)
        av->arg = arg;
        LIST_INSERT_HEAD(&accept_queue.queue, av, entry);
 
-       av->ev = thread_add_read(master, accept_cb, av, av->fd);
+       av->ev = NULL;
+       thread_add_read(master, accept_cb, av, av->fd, &av->ev);
 
        log_debug("%s: accepting on fd %d", __func__, fd);
 
@@ -85,7 +86,8 @@ accept_pause(void)
 {
        log_debug(__func__);
        accept_unarm();
-       accept_queue.evt = thread_add_timer(master, accept_timeout, NULL, 1);
+       accept_queue.evt = NULL;
+       thread_add_timer(master, accept_timeout, NULL, 1, &accept_queue.evt);
 }
 
 void
@@ -102,8 +104,10 @@ static void
 accept_arm(void)
 {
        struct accept_ev        *av;
-       LIST_FOREACH(av, &accept_queue.queue, entry)
-               av->ev = thread_add_read(master, accept_cb, av, av->fd);
+       LIST_FOREACH(av, &accept_queue.queue, entry) {
+               av->ev = NULL;
+               thread_add_read(master, accept_cb, av, av->fd, &av->ev);
+       }
 }
 
 static void
@@ -118,7 +122,8 @@ static int
 accept_cb(struct thread *thread)
 {
        struct accept_ev        *av = THREAD_ARG(thread);
-       av->ev = thread_add_read(master, accept_cb, av, av->fd);
+       av->ev = NULL;
+       thread_add_read(master, accept_cb, av, av->fd, &av->ev);
        av->accept_cb(thread);
 
        return (0);