]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Fix behaviour of empty dhcp-option=option6:dns-server, which should inhibit sending...
authorSimon Kelley <simon@thekelleys.org.uk>
Tue, 25 Aug 2015 22:08:39 +0000 (23:08 +0100)
committerSimon Kelley <simon@thekelleys.org.uk>
Tue, 25 Aug 2015 22:08:39 +0000 (23:08 +0100)
src/rfc3315.c

index 2665d0d3294a478e8cd4086389d466acaeed81c2..3f1f9ee8f3d960ba09383337a923a4823e86108f 100644 (file)
@@ -1320,15 +1320,16 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh)
       
       if (opt_cfg->opt == OPTION6_REFRESH_TIME)
        done_refresh = 1;
+       
+      if (opt_cfg->opt == OPTION6_DNS_SERVER)
+       done_dns = 1;
       
-      if (opt_cfg->flags & DHOPT_ADDR6)
+      /* Empty DNS_SERVER option will not set DHOPT_ADDR6 */
+      if ((opt_cfg->flags & DHOPT_ADDR6) || opt_cfg->opt == OPTION6_DNS_SERVER)
        {
          int len, j;
          struct in6_addr *a;
          
-         if (opt_cfg->opt == OPTION6_DNS_SERVER)
-           done_dns = 1;
-         
          for (a = (struct in6_addr *)opt_cfg->val, len = opt_cfg->len, j = 0; 
               j < opt_cfg->len; j += IN6ADDRSZ, a++)
            if ((IN6_IS_ADDR_ULA_ZERO(a) && IN6_IS_ADDR_UNSPECIFIED(state->ula_addr)) ||