diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2014-06-05 22:38:53 +0100 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2014-06-05 22:38:53 +0100 |
commit | a03f8d4c37c9e52833ce2ad7d9744b3c587efb14 (patch) | |
tree | 62ce93aee9cf0fe7118987c4925466474d2e80f4 | |
parent | c4a093768380afcf1d2d4def50380392295b36b8 (diff) | |
download | dnsmasq-a03f8d4c37c9e52833ce2ad7d9744b3c587efb14.tar.gz |
Suppress re-entrant calls to dhcp_construct_contexts()v2.72test2
-rw-r--r-- | src/dhcp6.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dhcp6.c b/src/dhcp6.c index bc48fdd..0e470cf 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -708,12 +708,20 @@ static int construct_worker(struct in6_addr *local, int prefix, void dhcp_construct_contexts(time_t now) { + static int active = 0; struct dhcp_context *context, *tmp, **up; struct cparam param; param.newone = 0; param.newname = 0; param.now = now; + /* Various calls that we make may end up calling iface_enumerate(), which can then + call us again, We're NOT re-entrant, so ignore a second invokation. */ + if (active) + return; + + active = 1; + for (context = daemon->dhcp6; context; context = context->next) if (context->flags & CONTEXT_CONSTRUCTED) context->flags |= CONTEXT_GC; @@ -771,6 +779,8 @@ void dhcp_construct_contexts(time_t now) /* Not doing DHCP, so no lease system, manage alarms for ra only */ send_alarm(periodic_ra(now), now); } + + active = 0; } #endif |