More IPv6 address allocation fixes.

This commit is contained in:
Simon Kelley
2013-01-10 11:47:38 +00:00
parent 39f6a04ca4
commit baeb3adf21
2 changed files with 16 additions and 14 deletions

View File

@@ -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;