]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Support DHCP DNS server option if we're not doing DNS.
authorSimon Kelley <simon@thekelleys.org.uk>
Sun, 17 Feb 2013 16:41:35 +0000 (16:41 +0000)
committerSimon Kelley <simon@thekelleys.org.uk>
Sun, 17 Feb 2013 16:41:35 +0000 (16:41 +0000)
CHANGELOG
src/rfc2131.c
src/rfc3315.c

index e4621ff6e0241bb2c81c5e8077a733f7a1b26aa2..649b972a5dea44f8bc7c22f89414a0988db65dde 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -26,6 +26,10 @@ version 2.66
            on other platforms. Many thanks to Tomas Hozza for
            spotting the problem, and doing invaluable discovery of
            the obscure and undocumented API required for the solution.
+
+           Don't send the default DHCP option advertising dnsmasq as
+           the local DNS server if dnsmasq is configured to not act
+           as DNS server, or it's configured to a non-standard port.
   
 
 version 2.65
index bbd4001895f0103628d1ed0b0f249d83e7df0674..fcb8dc5c68c6eb866a96fa9a8cb3196b80901404 100644 (file)
@@ -2234,7 +2234,8 @@ static void do_options(struct dhcp_context *context,
          !option_find2(OPTION_ROUTER))
        option_put(mess, end, OPTION_ROUTER, INADDRSZ, ntohl(context->router.s_addr));
       
-      if (in_list(req_options, OPTION_DNSSERVER) &&
+      if (daemon->port == NAMESERVER_PORT &&
+         in_list(req_options, OPTION_DNSSERVER) &&
          !option_find2(OPTION_DNSSERVER))
        option_put(mess, end, OPTION_DNSSERVER, INADDRSZ, ntohl(context->local.s_addr));
     }
index 2e1c7660d763ed156f415a51b16f2a41f459eb7c..75ec06b75741d531ed3283b6bb67e24345054596 100644 (file)
@@ -1265,7 +1265,7 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
       end_opt6(o);
     }
   
-  if (!done_dns && 
+  if (daemon->port == NAMESERVER_PORT && !done_dns && 
       (!IN6_IS_ADDR_UNSPECIFIED(&context->local6) ||
        !IN6_IS_ADDR_UNSPECIFIED(fallback)))
     {