[Dnsmasq-discuss] dnsmasq-2.61 not responding to ipv6 router solicitation requests

Simon Kelley simon at thekelleys.org.uk
Mon May 21 14:37:40 BST 2012


On 21/05/12 14:14, Marien Zwart wrote:
> Hi,
> 
> Running dnsmasq-2.61 as just a DNS server and ipv6 router advertisement
> daemon, with the following configuration:
> 
> domain-needed
> bogus-priv
> no-dhcp-interface=sixxs
> no-dhcp-interface=eth1
> no-dhcp-interface=eth0
> domain=marienz.net
> dhcp-range=2001:610:788::, slaac
> enable-ra
> 
> it sends periodic router advertisement packets just fine, according to
> syslog:
> 
> dnsmasq-dhcp[14136]: RTR-ADVERT(br0) 2001:610:788::
> 
> and other systems on the network eventually respond to those, but their
> router solicitation packets seem to be getting ignored (network traffic
> capture did see them arrive on the host dnsmasq runs on, but no response
> is sent).
> 
> I think this is at least partially caused by a bug in dnsmasq.c: the
> main loop only calls icmp6_packet if daemon->dhcp6 is non-NULL, but
> dnsmasq should respond to icmp6 packets if it's providing just RA
> services (no dhcpv6) too. That is: I think dnsmasq.c needs something
> like this:
> 
> diff --git a/src/dnsmasq.c b/src/dnsmasq.c
> index 1b951f0..11c2d73 100644
> --- a/src/dnsmasq.c
> +++ b/src/dnsmasq.c
> @@ -849,14 +849,11 @@ int main (int argc, char **argv)
>  	}
>  
>  #ifdef HAVE_DHCP6
> -      if (daemon->dhcp6)
> -	{
> -	  if (FD_ISSET(daemon->dhcp6fd, &rset))
> -	    dhcp6_packet(now);
> +      if (daemon->dhcp6 && FD_ISSET(daemon->dhcp6fd, &rset))
> +	  dhcp6_packet(now);
>  
> -	  if (daemon->ra_contexts && FD_ISSET(daemon->icmp6fd, &rset))
> -	    icmp6_packet();
> -	}
> +      if (daemon->ra_contexts && FD_ISSET(daemon->icmp6fd, &rset))
> +	  icmp6_packet();
>  #endif
>  
>  #  ifdef HAVE_SCRIPT
> 
> This brings this bit of code in line with other code in dnsmasq.c that
> touches dhcp6fd and icmp6fd. I've also confirmed daemon->dhcp6 really is
> NULL in my problematic dnsmasq instance.

That looks fine. I've added the patch and pushed 2.62test3. Many thanks.
> 
> Unfortunately this has not yet made my dnsmasq respond to router
> solicitation requests. Is there some known problem I might be hitting?
> 

2.62test3 has your fix and a couple of other that are relevant. Does
that fix things?


Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list