From 43c69727ea337ea1d376cd0be8a981e0adb70eff Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Wed, 31 Oct 2001 21:55:31 +0000 Subject: [PATCH] In several places, dighost.c called cancel_lookup() and then called requeue_lookup() on the canceled lookup. Because cancel_lookup() resets the retry count of the lookup to zero, the requeued lookups would not be retried at all (for example, in the case of UDP NS queries executed when doing "dig +search") or, in the case of TCP queries, retried indefinitely since the unsigned retry count of zero was subsequently decremented, causing it to wrap around to the largest unsigned integer value. [RT #1940] --- bin/dig/dighost.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 502b4506f7..21bb989ad4 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.233 2001/10/31 20:39:39 gson Exp $ */ +/* $Id: dighost.c,v 1.234 2001/10/31 21:55:31 gson Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -1061,9 +1061,9 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) if (!success) { success = ISC_TRUE; lookup_counter++; - cancel_lookup(query->lookup); lookup = requeue_lookup(query->lookup, ISC_FALSE); + cancel_lookup(query->lookup); lookup->doing_xfr = ISC_FALSE; if (!lookup->trace_root && section == DNS_SECTION_ANSWER) @@ -1117,9 +1117,9 @@ next_origin(dns_message_t *msg, dig_query_t *query) { * Then we just did rootorg; there's nothing left. */ return (ISC_FALSE); - cancel_lookup(query->lookup); lookup = requeue_lookup(query->lookup, ISC_TRUE); lookup->origin = ISC_LIST_NEXT(query->lookup->origin, link); + cancel_lookup(query->lookup); return (ISC_TRUE); } @@ -1735,9 +1735,9 @@ connect_timeout(isc_task_t *task, isc_event_t *event) { } else { debug("making new TCP request, %d tries left", l->retries); - cancel_lookup(l); l->retries--; requeue_lookup(l, ISC_TRUE); + cancel_lookup(l); } } else { fputs(l->cmdline, stdout);