mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix periodic loop
This commit is contained in:
@@ -596,7 +596,13 @@ void dhcp_construct_contexts(time_t now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param.newone)
|
if (param.newone)
|
||||||
lease_update_file(now);
|
{
|
||||||
|
if (daemon->dhcp || daemon->doing_dhcp6)
|
||||||
|
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,11 +102,8 @@ 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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user