[Dnsmasq-discuss] [PATCH] RADV: Send same RDNSS address as in DHCPv6

Simon Kelley simon at thekelleys.org.uk
Fri Jan 1 19:58:42 GMT 2016


Does the existing behaviour cause you problems? The rationale for why it
behaves the way it does is that link-local addresses are good IF client
and server are on the same link, since there's no possibility of
addresses changing or renumbering. A client getting DNS server addresses
from RADV is by definition on the same link as the server. One getting
DNS addresses by DHCP is not (there may be a DHCP relay involved) but
has DHCP to handle renumbering.

Cheers

Simon.



On 24/12/15 13:39, Pali Rohár wrote:
> Before this patch when both RADV and DHCPv6 is running and DNS server
> address was not configured then RADV were sending link-local address and
> DHCPv6 global address.
> 
> This patch change behaviour of RADV and when both RADV and DHCPv6 is
> running without configured DNS server then in RADV RDNSS will be same
> global address as in DHCPv6 instead link-local address.
> ---
>  man/dnsmasq.8 |    4 ++--
>  src/radv.c    |   22 ++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
> index 6a121fe..bb588d3 100644
> --- a/man/dnsmasq.8
> +++ b/man/dnsmasq.8
> @@ -1695,8 +1695,8 @@ the machine running dnsmasq. By default, the "managed address" bits are set, and
>  the "use SLAAC" bit is reset. This can be changed for individual
>  subnets with the mode keywords described in
>  .B --dhcp-range.
> -RFC6106 DNS parameters are included in the advertisements. By default,
> -the relevant link-local address of the machine running dnsmasq is sent
> +RFC6106 DNS parameters are included in the advertisements. By default
> +the relevant DHCPv6 address (or link-local when using SLAAC) of the machine running dnsmasq is sent
>  as recursive DNS server. If provided, the DHCPv6 options dns-server and
>  domain-search are used for the DNS server (RDNSS) and the domain serach list (DNSSL).
>  .TP
> diff --git a/src/radv.c b/src/radv.c
> index 39f1e92..15e116c 100644
> --- a/src/radv.c
> +++ b/src/radv.c
> @@ -482,6 +482,28 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad
>  	}
>      }
>  	
> +  if (daemon->port == NAMESERVER_PORT && !done_dns && parm.link_pref_time != 0 && parm.other)
> +    for (context = daemon->dhcp6; context; context = context->next)
> +      if (context->if_index == iface && !IN6_IS_ADDR_UNSPECIFIED(&context->local6))
> +	{
> +	  /* squash duplicates */
> +	  struct dhcp_context *c;
> +	  for (c = context->current; c; c = c->current)
> +	    if ((c->flags & CONTEXT_USED) &&
> +		IN6_ARE_ADDR_EQUAL(&context->local6, &c->local6))
> +	      break;
> +
> +	  if (!c)
> +	    {
> +	      done_dns = 1;
> +	      put_opt6_char(ICMP6_OPT_RDNSS);
> +	      put_opt6_char(3);
> +	      put_opt6_short(0);
> +	      put_opt6_long(min_pref_time);
> +	      put_opt6(&context->local6, IN6ADDRSZ);
> +	    }
> +	}
> +
>    if (daemon->port == NAMESERVER_PORT && !done_dns && parm.link_pref_time != 0)
>      {
>        /* default == us, as long as we are supplying DNS service. */
> 




More information about the Dnsmasq-discuss mailing list