]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Wed, 31 Oct 2001 23:04:26 +0000 (23:04 +0000)
committerMark Andrews <marka@isc.org>
Wed, 31 Oct 2001 23:04:26 +0000 (23:04 +0000)
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.

bin/dig/dighost.c

index aaed87a24e0f2c332974e0324a8080d25b333aef..e3c25756a41c17578049f4e9d4696e202031045a 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.221.2.5 2001/10/15 23:06:07 bwelling Exp $ */
+/* $Id: dighost.c,v 1.221.2.6 2001/10/31 23:04:26 marka Exp $ */
 
 /*
  * Notice to programmers:  Do not use this code as an example of how to
@@ -1054,9 +1054,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)
@@ -1110,9 +1110,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);
 }
 
@@ -1785,9 +1785,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);