]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1760. [bug] Host / net unreachable was not penalising rtt
authorMark Andrews <marka@isc.org>
Wed, 10 Nov 2004 21:46:48 +0000 (21:46 +0000)
committerMark Andrews <marka@isc.org>
Wed, 10 Nov 2004 21:46:48 +0000 (21:46 +0000)
                        estimates. [RT #12970]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 0f1a16e0a3f473af5b0af7a064e199aea885cf89..2be7680a6d46526627bce2dd9df2d01b780a2226 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,7 +8,8 @@
 
 1761.  [placeholder]   rt12971
 
-1760.  [placeholder]   rt12970
+1760.  [bug]           Host / net unreachable was not penalising rtt
+                       estimates. [RT #12970]
 
 1759.  [placeholder]   rt12942
 
index 08cec8d6f56810fc0b3b9d770eb098af0dafba66..29936a907bc54dd89160dbcfe3a992a6842b7bff 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.296 2004/10/21 01:53:44 marka Exp $ */
+/* $Id: resolver.c,v 1.297 2004/11/10 21:46:48 marka Exp $ */
 
 #include <config.h>
 
@@ -524,7 +524,7 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
                         */
                        INSIST(no_response);
                        rtt = query->addrinfo->srtt +
-                               (100000 * fctx->restarts);
+                               (200000 * fctx->restarts);
                        if (rtt > 10000000)
                                rtt = 10000000;
                        /*
@@ -791,7 +791,13 @@ resquery_senddone(isc_task_t *task, isc_event_t *event) {
                                isc_socket_detach(&query->tcpsocket);
                        resquery_destroy(&query);
                }
-       } else if (sevent->result != ISC_R_SUCCESS)
+       } else if (sevent->result == ISC_R_HOSTUNREACH ||
+                  sevent->result == ISC_R_NETUNREACH)
+               /*
+                * No route to remote.
+                */
+               fctx_cancelquery(&query, NULL, NULL, ISC_TRUE);
+       else if (sevent->result != ISC_R_SUCCESS)
                fctx_cancelquery(&query, NULL, NULL, ISC_FALSE);
 
        isc_event_free(&event);
@@ -1378,6 +1384,13 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
                                                 ISC_FALSE);
                                fctx_done(fctx, result);
                        }
+               } else if (sevent->result == ISC_R_HOSTUNREACH ||
+                          sevent->result == ISC_R_NETUNREACH) {
+                       /*
+                        * No route to remote.
+                        */
+                       isc_socket_detach(&query->tcpsocket);
+                       fctx_cancelquery(&query, NULL, NULL, ISC_TRUE);
                } else {
                        isc_socket_detach(&query->tcpsocket);
                        fctx_cancelquery(&query, NULL, NULL, ISC_FALSE);
@@ -1387,8 +1400,6 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
        isc_event_free(&event);
 }
 
-
-
 static void
 fctx_finddone(isc_task_t *task, isc_event_t *event) {
        fetchctx_t *fctx;