mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Handle standard and contructed dhcp-ranges on the same interface.
This commit is contained in:
@@ -23,6 +23,12 @@ version 2.80
|
|||||||
which packets should be dumped is given by the --dumpmask
|
which packets should be dumped is given by the --dumpmask
|
||||||
option.
|
option.
|
||||||
|
|
||||||
|
Handle the case of both standard and constructed dhcp-ranges on the
|
||||||
|
same interface better. We don't now contruct a dhcp-range if there's
|
||||||
|
already one specified. This allows the specified interface to
|
||||||
|
have different parameters and avoids advertising the same
|
||||||
|
prefix twice. Thanks to Luis Marsano for spotting this case.
|
||||||
|
|
||||||
|
|
||||||
version 2.79
|
version 2.79
|
||||||
Fix parsing of CNAME arguments, which are confused by extra spaces.
|
Fix parsing of CNAME arguments, which are confused by extra spaces.
|
||||||
|
|||||||
29
src/dhcp6.c
29
src/dhcp6.c
@@ -667,23 +667,28 @@ static int construct_worker(struct in6_addr *local, int prefix,
|
|||||||
end6 = *local;
|
end6 = *local;
|
||||||
setaddr6part(&end6, addr6part(&template->end6));
|
setaddr6part(&end6, addr6part(&template->end6));
|
||||||
|
|
||||||
|
/* If there's an absolute address context covering this address
|
||||||
|
then don't contruct one as well. */
|
||||||
for (context = daemon->dhcp6; context; context = context->next)
|
for (context = daemon->dhcp6; context; context = context->next)
|
||||||
if ((context->flags & CONTEXT_CONSTRUCTED) &&
|
if (!(context->flags & CONTEXT_TEMPLATE) &&
|
||||||
IN6_ARE_ADDR_EQUAL(&start6, &context->start6) &&
|
IN6_ARE_ADDR_EQUAL(&start6, &context->start6) &&
|
||||||
IN6_ARE_ADDR_EQUAL(&end6, &context->end6))
|
IN6_ARE_ADDR_EQUAL(&end6, &context->end6))
|
||||||
{
|
{
|
||||||
int flags = context->flags;
|
if (context->flags & CONTEXT_CONSTRUCTED)
|
||||||
context->flags &= ~(CONTEXT_GC | CONTEXT_OLD);
|
|
||||||
if (flags & CONTEXT_OLD)
|
|
||||||
{
|
{
|
||||||
/* address went, now it's back */
|
int cflags = context->flags;
|
||||||
log_context(AF_INET6, context);
|
context->flags &= ~(CONTEXT_GC | CONTEXT_OLD);
|
||||||
/* fast RAs for a while */
|
if (cflags & CONTEXT_OLD)
|
||||||
ra_start_unsolicited(param->now, context);
|
{
|
||||||
param->newone = 1;
|
/* address went, now it's back */
|
||||||
/* Add address to name again */
|
log_context(AF_INET6, context);
|
||||||
if (context->flags & CONTEXT_RA_NAME)
|
/* fast RAs for a while */
|
||||||
param->newname = 1;
|
ra_start_unsolicited(param->now, context);
|
||||||
|
param->newone = 1;
|
||||||
|
/* Add address to name again */
|
||||||
|
if (context->flags & CONTEXT_RA_NAME)
|
||||||
|
param->newname = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user