From: Roy Marples Date: Thu, 16 May 2013 14:42:18 +0000 (+0000) Subject: ELOOP_QUEUE 0 is now all queues X-Git-Tag: v5.99.7~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e6ca60eea68613139d71ea58bad599447933e59d;p=thirdparty%2Fdhcpcd.git ELOOP_QUEUE 0 is now all queues This allows DHCPv6 and IPv6RS to remove DAD callbacks from the IPv6NS queue. --- diff --git a/dhcp6.c b/dhcp6.c index 67c4289c..45224d97 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -44,7 +44,7 @@ #include #include -#define ELOOP_QUEUE 2 +#define ELOOP_QUEUE 3 #include "config.h" #include "common.h" @@ -608,7 +608,7 @@ dhcp6_freedrop_addrs(struct interface *ifp, int drop) while ((ap = TAILQ_FIRST(&state->addrs))) { TAILQ_REMOVE(&state->addrs, ap, next); if (ap->dadcallback) - eloop_timeout_delete(NULL, ap->dadcallback); + eloop_q_timeout_delete(0, NULL, ap->dadcallback); /* Only drop the address if no other RAs have assigned it. * This is safe because the RA is removed from the list * before we are called. */ diff --git a/eloop.c b/eloop.c index 2936ca14..506ad77e 100644 --- a/eloop.c +++ b/eloop.c @@ -244,7 +244,7 @@ eloop_q_timeouts_delete_v(int queue, void *arg, void (*f)(void *); TAILQ_FOREACH_SAFE(t, &timeouts, next, tt) { - if (t->queue == queue && t->arg == arg && + if ((queue == 0 || t->queue == queue) && t->arg == arg && t->callback != callback) { va_copy(va, v); diff --git a/eloop.h b/eloop.h index 235ec110..e8592db8 100644 --- a/eloop.h +++ b/eloop.h @@ -32,7 +32,7 @@ #include #ifndef ELOOP_QUEUE - #define ELOOP_QUEUE 0 + #define ELOOP_QUEUE 1 #endif #define eloop_timeout_add_tv(a, b, c) \ diff --git a/ipv6ns.c b/ipv6ns.c index ba1eb56e..3221b158 100644 --- a/ipv6ns.c +++ b/ipv6ns.c @@ -46,7 +46,7 @@ # include #endif -#define ELOOP_QUEUE 1 +#define ELOOP_QUEUE 2 #include "common.h" #include "dhcpcd.h" #include "dhcp6.h" diff --git a/ipv6rs.c b/ipv6rs.c index 58b1bdc6..4dd37b36 100644 --- a/ipv6rs.c +++ b/ipv6rs.c @@ -45,7 +45,7 @@ #include #include -#define ELOOP_QUEUE 1 +#define ELOOP_QUEUE 2 #include "common.h" #include "dhcpcd.h" #include "dhcp6.h" @@ -306,7 +306,7 @@ ipv6rs_freedrop_addrs(struct ra *rap, int drop) while ((ap = TAILQ_FIRST(&rap->addrs))) { TAILQ_REMOVE(&rap->addrs, ap, next); if (ap->dadcallback) - eloop_timeout_delete(NULL, ap->dadcallback); + eloop_q_timeout_delete(0, NULL, ap->dadcallback); /* Only drop the address if no other RAs have assigned it. * This is safe because the RA is removed from the list * before we are called. */