From: Mark Andrews Date: Wed, 10 Nov 2004 21:46:48 +0000 (+0000) Subject: 1760. [bug] Host / net unreachable was not penalising rtt X-Git-Tag: v9.2.5rc1~28^2~47 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=71e7ac828e9f4f2b124455b00c3d11560aa5d4c1;p=thirdparty%2Fbind9.git 1760. [bug] Host / net unreachable was not penalising rtt estimates. [RT #12970] --- diff --git a/CHANGES b/CHANGES index 0f1a16e0a3f..2be7680a6d4 100644 --- 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 diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 08cec8d6f56..29936a907bc 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -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 @@ -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;