diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2013-02-17 16:41:35 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2013-02-17 16:41:35 +0000 |
commit | a21e27bc991bb22b1926ef2344e66b82abf332b4 (patch) | |
tree | 0270308543d491e5cdd9101c4ac4c574a0b888f4 | |
parent | b0ff858e782df0f6e4eccef564a183106635dacf (diff) | |
download | dnsmasq-a21e27bc991bb22b1926ef2344e66b82abf332b4.tar.gz |
Support DHCP DNS server option if we're not doing DNS.v2.66test14
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | src/rfc2131.c | 3 | ||||
-rw-r--r-- | src/rfc3315.c | 2 |
3 files changed, 7 insertions, 2 deletions
@@ -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 diff --git a/src/rfc2131.c b/src/rfc2131.c index bbd4001..fcb8dc5 100644 --- a/src/rfc2131.c +++ b/src/rfc2131.c @@ -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)); } diff --git a/src/rfc3315.c b/src/rfc3315.c index 2e1c766..75ec06b 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -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))) { |