Fix RA problems with two interfaces on same IPv6 subnet.

This commit is contained in:
Simon Kelley
2020-01-27 22:53:07 +00:00
parent d9603ef781
commit cd672933c9
3 changed files with 21 additions and 12 deletions

View File

@@ -891,11 +891,21 @@ static int iface_search(struct in6_addr *local, int prefix,
{
struct search_param *param = vparam;
struct dhcp_context *context;
struct iname *tmp;
(void)scope;
(void)preferred;
(void)valid;
/* ignore interfaces we're not doing DHCP on. */
if (!indextoname(daemon->icmp6fd, if_index, param->name) ||
!iface_check(AF_LOCAL, NULL, param->name, NULL))
return 1;
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
if (tmp->name && wildcard_match(tmp->name, param->name))
return 1;
for (context = daemon->dhcp6; context; context = context->next)
if (!(context->flags & (CONTEXT_TEMPLATE | CONTEXT_OLD)) &&
prefix <= context->prefix &&
@@ -907,17 +917,9 @@ static int iface_search(struct in6_addr *local, int prefix,
/* found an interface that's overdue for RA determine new
timeout value and arrange for RA to be sent unless interface is
still doing DAD.*/
if (!(flags & IFACE_TENTATIVE))
param->iface = if_index;
/* should never fail */
if (!indextoname(daemon->icmp6fd, if_index, param->name))
{
param->iface = 0;
return 0;
}
new_timeout(context, param->name, param->now);
/* zero timers for other contexts on the same subnet, so they don't timeout