mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
More IPv6 address allocation fixes.
This commit is contained in:
@@ -211,7 +211,8 @@ static int complete_context6(struct in6_addr *local, int prefix,
|
||||
|
||||
for (context = daemon->dhcp6; context; context = context->next)
|
||||
{
|
||||
if (!(context->flags & CONTEXT_TEMPLATE) &&
|
||||
if ((context->flags & CONTEXT_DHCP) &&
|
||||
!(context->flags & CONTEXT_TEMPLATE) &&
|
||||
prefix == context->prefix &&
|
||||
is_same_net6(local, &context->start6, prefix) &&
|
||||
is_same_net6(local, &context->end6, prefix))
|
||||
@@ -361,8 +362,7 @@ struct dhcp_context *address6_valid(struct dhcp_context *context,
|
||||
struct dhcp_context *tmp;
|
||||
|
||||
for (tmp = context; tmp; tmp = tmp->current)
|
||||
if ((tmp->flags & CONTEXT_STATIC) &&
|
||||
is_same_net6(&tmp->start6, taddr, tmp->prefix) &&
|
||||
if (is_same_net6(&tmp->start6, taddr, tmp->prefix) &&
|
||||
match_netid(tmp->filter, netids, 1))
|
||||
return tmp;
|
||||
|
||||
|
||||
@@ -82,18 +82,20 @@ static int dhcp6_maybe_relay(struct in6_addr *link_address, struct dhcp_netid **
|
||||
{
|
||||
struct dhcp_context *c;
|
||||
context = NULL;
|
||||
|
||||
if (!IN6_IS_ADDR_LOOPBACK(link_address) &&
|
||||
!IN6_IS_ADDR_LINKLOCAL(link_address) &&
|
||||
!IN6_IS_ADDR_MULTICAST(link_address))
|
||||
for (c = daemon->dhcp6; c; c = c->next)
|
||||
if ((c->flags & CONTEXT_DHCP) &&
|
||||
!(c->flags & CONTEXT_TEMPLATE) &&
|
||||
is_same_net6(link_address, &c->start6, c->prefix) &&
|
||||
is_same_net6(link_address, &c->end6, c->prefix))
|
||||
{
|
||||
c->current = context;
|
||||
context = c;
|
||||
}
|
||||
|
||||
for (c = daemon->dhcp6; c; c = c->next)
|
||||
if (!IN6_IS_ADDR_LOOPBACK(link_address) &&
|
||||
!IN6_IS_ADDR_LINKLOCAL(link_address) &&
|
||||
!IN6_IS_ADDR_MULTICAST(link_address) &&
|
||||
is_same_net6(link_address, &c->start6, c->prefix) &&
|
||||
is_same_net6(link_address, &c->end6, c->prefix))
|
||||
{
|
||||
c->current = context;
|
||||
context = c;
|
||||
}
|
||||
|
||||
if (!context)
|
||||
{
|
||||
inet_ntop(AF_INET6, link_address, daemon->addrbuff, ADDRSTRLEN);
|
||||
|
||||
Reference in New Issue
Block a user