Commit 7558ecd9 authored by Simon Kelley's avatar Simon Kelley

Fix periodic loop

parent 1f776932
...@@ -596,7 +596,13 @@ void dhcp_construct_contexts(time_t now) ...@@ -596,7 +596,13 @@ void dhcp_construct_contexts(time_t now)
} }
if (param.newone) if (param.newone)
{
if (daemon->dhcp || daemon->doing_dhcp6)
lease_update_file(now); lease_update_file(now);
else
/* Not doing DHCP, so no lease system, manage alarms for ra only */
send_alarm(periodic_ra(now), now);
}
} }
static int join_multicast_worker(struct in6_addr *local, int prefix, static int join_multicast_worker(struct in6_addr *local, int prefix,
......
...@@ -102,10 +102,7 @@ void ra_start_unsolicted(time_t now, struct dhcp_context *context) ...@@ -102,10 +102,7 @@ void ra_start_unsolicted(time_t now, struct dhcp_context *context)
context->ra_time = now; context->ra_time = now;
else else
for (context = daemon->dhcp6; context; context = context->next) for (context = daemon->dhcp6; context; context = context->next)
if (context->flags & CONTEXT_RA)
context->ra_time = now + (rand16()/13000); /* range 0 - 5 */ context->ra_time = now + (rand16()/13000); /* range 0 - 5 */
else
context->ra_time = 0;
/* re-do frequently for a minute or so, in case the first gets lost. */ /* re-do frequently for a minute or so, in case the first gets lost. */
ra_short_period_start = now; ra_short_period_start = now;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment