]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2564. [bug] Only take EDNS fallback steps when processing timeouts.
authorMark Andrews <marka@isc.org>
Fri, 27 Feb 2009 23:05:22 +0000 (23:05 +0000)
committerMark Andrews <marka@isc.org>
Fri, 27 Feb 2009 23:05:22 +0000 (23:05 +0000)
                        [RT #19405]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 4892d0a2138502bf54efec629ea34917699b8ccd..0178e55855183cb8159a660e76973e4aac9a749f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,5 @@
-2564.  [bug]           'named' was treating a TCP retry as a timeout when
-                       deciding whether to perform a EDNS fallback step.
-                       [RT #19393]
+2564.  [bug]           Only take EDNS fallback steps when processing timeouts.
+                       [RT #19405]
 
 2563.  [bug]           Dig could leak a socket causing it to wait forever
                        to exit. [RT #19359]
index 1c14c3e52873171215d0a93015b303505bed486d..39ff4bd18ee2462c248c88540c70ebcb053e393c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.384.14.8 2009/02/25 22:47:12 marka Exp $ */
+/* $Id: resolver.c,v 1.384.14.9 2009/02/27 23:05:22 marka Exp $ */
 
 /*! \file */
 
@@ -229,6 +229,7 @@ struct fetchctx {
         * is used for EDNS0 black hole detection.
         */
        unsigned int                    timeouts;
+
        /*%
         * Look aside state for DS lookups.
         */
@@ -270,6 +271,7 @@ struct fetchctx {
        unsigned int                    adberr;
        unsigned int                    findfail;
        unsigned int                    valfail;
+       isc_boolean_t                   timeout;
 };
 
 #define FCTX_MAGIC                     ISC_MAGIC('F', '!', '!', '!')
@@ -1639,9 +1641,8 @@ resquery_send(resquery_t *query) {
                query->options |= DNS_FETCHOPT_NOEDNS0;
 
        /*
-        * Handle UDP timeouts by reducing the UDP response size to 512
-        * bytes then if that doesn't work disabling EDNS (includes DO)
-        * and CD.
+        * Handle timeouts by reducing the UDP response size to 512 bytes
+        * then if that doesn't work disabling EDNS (includes DO) and CD.
         *
         * These timeout can be due to:
         *      * broken nameservers that don't respond to EDNS queries.
@@ -1653,7 +1654,7 @@ resquery_send(resquery_t *query) {
         *        or CD.
         *      * packet loss / link outage.
         */
-       if ((query->options & DNS_FETCHOPT_TCP) == 0) {
+       if (fctx->timeout) {
                if ((triededns512(fctx, &query->addrinfo->sockaddr) ||
                     fctx->timeouts >= (MAX_EDNS0_TIMEOUTS * 2)) &&
                    (query->options & DNS_FETCHOPT_NOEDNS0) == 0) {
@@ -1666,6 +1667,7 @@ resquery_send(resquery_t *query) {
                        fctx->reason = "reducing the advertised EDNS UDP "
                                       "packet size to 512 octets";
                }
+               fctx->timeout = ISC_FALSE;
        }
 
        /*
@@ -3012,6 +3014,7 @@ fctx_timeout(isc_task_t *task, isc_event_t *event) {
                isc_result_t result;
 
                fctx->timeouts++;
+               fctx->timeout = ISC_TRUE;
                /*
                 * We could cancel the running queries here, or we could let
                 * them keep going.  Since we normally use separate sockets for
@@ -3358,6 +3361,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
        fctx->reason = NULL;
        fctx->rand_buf = 0;
        fctx->rand_bits = 0;
+       fctx->timeout = ISC_FALSE;
 
        dns_name_init(&fctx->nsname, NULL);
        fctx->nsfetch = NULL;
@@ -5888,6 +5892,7 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
        }
 
        fctx->timeouts = 0;
+       fctx->timeout = ISC_FALSE;
 
        /*
         * XXXRTH  We should really get the current time just once.  We