Commit 14ffa077 authored by Simon Kelley's avatar Simon Kelley

Fix init of per server EDNS UDP packet size.

parent 87985855
...@@ -61,6 +61,10 @@ version 2.76 ...@@ -61,6 +61,10 @@ version 2.76
garbage dhcp-options being sent. Thanks to Marc Branchaud garbage dhcp-options being sent. Thanks to Marc Branchaud
for spotting this. for spotting this.
Fix wrong value for EDNS UDP packet size when using
--servers-file to define upstream DNS servers. Thanks to
Scott Bonar for the bug report.
version 2.75 version 2.75
Fix reversion on 2.74 which caused 100% CPU use when a Fix reversion on 2.74 which caused 100% CPU use when a
......
...@@ -1409,7 +1409,6 @@ void add_update_server(int flags, ...@@ -1409,7 +1409,6 @@ void add_update_server(int flags,
serv->domain = domain_str; serv->domain = domain_str;
serv->next = next; serv->next = next;
serv->queries = serv->failed_queries = 0; serv->queries = serv->failed_queries = 0;
serv->edns_pktsz = daemon->edns_pktsz;
#ifdef HAVE_LOOP #ifdef HAVE_LOOP
serv->uid = rand32(); serv->uid = rand32();
#endif #endif
...@@ -1447,6 +1446,10 @@ void check_servers(void) ...@@ -1447,6 +1446,10 @@ void check_servers(void)
{ {
if (!(serv->flags & (SERV_LITERAL_ADDRESS | SERV_NO_ADDR | SERV_USE_RESOLV | SERV_NO_REBIND))) if (!(serv->flags & (SERV_LITERAL_ADDRESS | SERV_NO_ADDR | SERV_USE_RESOLV | SERV_NO_REBIND)))
{ {
/* Init edns_pktsz for newly created server records. */
if (serv->edns_pktsz == 0)
serv->edns_pktsz = daemon->edns_pktsz;
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
if (option_bool(OPT_DNSSEC_VALID)) if (option_bool(OPT_DNSSEC_VALID))
{ {
......
...@@ -4612,21 +4612,17 @@ void read_opts(int argc, char **argv, char *compile_opts) ...@@ -4612,21 +4612,17 @@ void read_opts(int argc, char **argv, char *compile_opts)
{ {
struct server *tmp; struct server *tmp;
for (tmp = daemon->servers; tmp; tmp = tmp->next) for (tmp = daemon->servers; tmp; tmp = tmp->next)
{ if (!(tmp->flags & SERV_HAS_SOURCE))
tmp->edns_pktsz = daemon->edns_pktsz; {
if (tmp->source_addr.sa.sa_family == AF_INET)
if (!(tmp->flags & SERV_HAS_SOURCE)) tmp->source_addr.in.sin_port = htons(daemon->query_port);
{
if (tmp->source_addr.sa.sa_family == AF_INET)
tmp->source_addr.in.sin_port = htons(daemon->query_port);
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
else if (tmp->source_addr.sa.sa_family == AF_INET6) else if (tmp->source_addr.sa.sa_family == AF_INET6)
tmp->source_addr.in6.sin6_port = htons(daemon->query_port); tmp->source_addr.in6.sin6_port = htons(daemon->query_port);
#endif #endif
} }
} }
}
if (daemon->host_records) if (daemon->host_records)
{ {
struct host_record *hr; struct host_record *hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment