[Dnsmasq-discuss] send_ra never sending Router Advertisements
Simon Kelley
simon at thekelleys.org.uk
Mon Sep 24 16:26:29 BST 2012
On 24/09/12 15:47, Kaspar Schleiser wrote:
> Hi,
>
> Current dnsmasq (tried from 2.62 onwards) doesn't reply to router
> solicits. I think I found the problem.
>
> This is from radv.c from HEAD (commit 35239a30):
>
> -------
> 205 parm.other = 0;
> 206 parm.found_context = 0;
>
> parm.found_context gets initialized here.
>
> 207 parm.if_name = iface_name;
> 208 parm.first = 1;
> 209
> 210 /* set tag with name == interface */
> 211 iface_id.net = iface_name;
> 212 iface_id.next = NULL;
> 213 parm.tags = &iface_id;
> 214
> 215 for (context = daemon->ra_contexts; context; context = context->next)
> 216 {
> 217 context->flags &= ~CONTEXT_RA_DONE;
> 218 context->netid.next = &context->netid;
> 219 }
> 220
> 221 if (!iface_enumerate(AF_INET6, &parm, add_prefixes) ||
> 222 !parm.found_context)
> 223 return;
> ----
>
> If parm.found_context is zero, the function just returns.
> iface_enumerate is the only function called, and it doesn't touch
> param.found_context. So send_ra always returns.
>
> Removing the "!parm.found_context" from that if-statement in line 222
> makes dnsmasq answer to RS again.
>
> Am I missing something?
Yes. Line 221 passed a pointer to the function add_prefixes() to
iface_enumerate, and iface_enumerate() will call that add_prefixes for
every address of every interface on the system
add_prefixes() does, amongst other things
if (interface_index == param_index)
for (.... all contexts ....)
if (<address in on same subnet as context>)
parm.found_context = 1;
Checking though todays logs on the dogfood test machine, I can see a
DHCPSOLICIT and the corresponding reply.
I'm not saying there isn't a problem, but if there is, it's More
Complicated Than That.
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list