]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ELOOP_QUEUE 0 is now all queues
authorRoy Marples <roy@marples.name>
Thu, 16 May 2013 14:42:18 +0000 (14:42 +0000)
committerRoy Marples <roy@marples.name>
Thu, 16 May 2013 14:42:18 +0000 (14:42 +0000)
This allows DHCPv6 and IPv6RS to remove DAD callbacks from the IPv6NS queue.

dhcp6.c
eloop.c
eloop.h
ipv6ns.c
ipv6rs.c

diff --git a/dhcp6.c b/dhcp6.c
index 67c4289cb60dcb6a22ad41a7b555dbc315692907..45224d97aee55a5c22cf316c367abf4561d7d8ae 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -44,7 +44,7 @@
 #include <syslog.h>
 #include <unistd.h>
 
-#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 2936ca148dddc23b159bd20b95a77383cb2decf6..506ad77ede29f8872ed55ad31b3cd811f054481e 100644 (file)
--- 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 235ec1109ebe6460e67a119eaa36e5841dd98de8..e8592db8989f3f06fce4cd2273fd2fe1839a4b90 100644 (file)
--- a/eloop.h
+++ b/eloop.h
@@ -32,7 +32,7 @@
 #include <time.h>
 
 #ifndef ELOOP_QUEUE
-  #define ELOOP_QUEUE 0
+  #define ELOOP_QUEUE 1
 #endif
 
 #define eloop_timeout_add_tv(a, b, c) \
index ba1eb56ec4256e3d65a7882a55c7b0cb34007522..3221b1588b12f4499407a2a92c31ec35b8e05f59 100644 (file)
--- a/ipv6ns.c
+++ b/ipv6ns.c
@@ -46,7 +46,7 @@
 #  include <linux/ipv6.h>
 #endif
 
-#define ELOOP_QUEUE 1
+#define ELOOP_QUEUE 2
 #include "common.h"
 #include "dhcpcd.h"
 #include "dhcp6.h"
index 58b1bdc69259d850cd19f8d3e9c76d46626e3435..4dd37b3610b8c81946f0eb0f406407a7f0542950 100644 (file)
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -45,7 +45,7 @@
 #include <syslog.h>
 #include <unistd.h>
 
-#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. */