Commit 0a496f05 authored by Maarten de Vries's avatar Maarten de Vries Committed by Simon Kelley

Do unsolicited RAs for interfaces which appear after dnsmasq startup.

I noticed that dnsmasq often wasn't sending any unsolicited RAs for me.

This turned out to happen when the interface (a bridge interface) wasn't
created yet at the time dnsmasq started. When dnsmasq is started after
the interface is created, it sends RAs as expected. I assume this also
extends to other types of virtual interfaces that are created after
dnsmasq starts.

Digging into the source, it seems to be caused by a missing call to
ra_start_unsolicited for non-template contexts in construct_worker from
src/dhcp6.c. The attached patch adds that call, but only if the
interface index or address changed to prevent doing fast RAs for no reason.

I tested it on my own server and it appears to work as expected. When
the interface is created and configured, dnsmasq does fast RAs for a
while and then settles into slow RAs.
parent e27825b0
...@@ -647,6 +647,13 @@ static int construct_worker(struct in6_addr *local, int prefix, ...@@ -647,6 +647,13 @@ static int construct_worker(struct in6_addr *local, int prefix,
is_same_net6(local, &template->start6, template->prefix) && is_same_net6(local, &template->start6, template->prefix) &&
is_same_net6(local, &template->end6, template->prefix)) is_same_net6(local, &template->end6, template->prefix))
{ {
/* First time found, do fast RA. */
if (template->if_index != if_index || !IN6_ARE_ADDR_EQUAL(&template->local6, local))
{
ra_start_unsolicited(param->now, template);
param->newone = 1;
}
template->if_index = if_index; template->if_index = if_index;
template->local6 = *local; template->local6 = *local;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment