From e30e7913c9f0978ae60b4e4572034a4b9ffb46de Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 25 Jun 2004 04:39:19 +0000 Subject: [PATCH] 1679. [bug] When there was a single nameserver with multiple addresses for a zone not all addresses were tried. [RT #11706] --- CHANGES | 4 ++- lib/dns/resolver.c | 70 ++++++++++++++++++++++++---------------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/CHANGES b/CHANGES index f7efb0cd99..f4aca61209 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ 1680. [placeholder] rt11697 -1679. [placeholder] rt11706 +1679. [bug] When there was a single nameserver with multiple + addresses for a zone not all addresses were tried. + [RT #11706] 1678. [bug] RRSIG should use TYPEXXXXX for unknown types. diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index c35b15348b..3f210f5861 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.289 2004/06/07 03:28:55 marka Exp $ */ +/* $Id: resolver.c,v 1.290 2004/06/25 04:39:19 marka Exp $ */ #include @@ -2102,23 +2102,25 @@ fctx_nextaddress(fetchctx_t *fctx) { * Find the first unmarked addrinfo. */ addrinfo = NULL; - while (find != fctx->find) { - for (addrinfo = ISC_LIST_HEAD(find->list); - addrinfo != NULL; - addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { - if (!UNMARKED(addrinfo)) - continue; - possibly_mark(fctx, addrinfo); - if (UNMARKED(addrinfo)) { - addrinfo->flags |= FCTX_ADDRINFO_MARK; - break; + if (find != NULL) { + do { + for (addrinfo = ISC_LIST_HEAD(find->list); + addrinfo != NULL; + addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { + if (!UNMARKED(addrinfo)) + continue; + possibly_mark(fctx, addrinfo); + if (UNMARKED(addrinfo)) { + addrinfo->flags |= FCTX_ADDRINFO_MARK; + break; + } } - } - if (addrinfo != NULL) - break; - find = ISC_LIST_NEXT(find, publink); - if (find != fctx->find && find == NULL) - find = ISC_LIST_HEAD(fctx->finds); + if (addrinfo != NULL) + break; + find = ISC_LIST_NEXT(find, publink); + if (find != fctx->find && find == NULL) + find = ISC_LIST_HEAD(fctx->finds); + } while (find != fctx->find); } fctx->find = find; @@ -2144,23 +2146,25 @@ fctx_nextaddress(fetchctx_t *fctx) { * Find the first unmarked addrinfo. */ addrinfo = NULL; - while (find != fctx->altfind) { - for (addrinfo = ISC_LIST_HEAD(find->list); - addrinfo != NULL; - addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { - if (!UNMARKED(addrinfo)) - continue; - possibly_mark(fctx, addrinfo); - if (UNMARKED(addrinfo)) { - addrinfo->flags |= FCTX_ADDRINFO_MARK; - break; + if (find != NULL) { + do { + for (addrinfo = ISC_LIST_HEAD(find->list); + addrinfo != NULL; + addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { + if (!UNMARKED(addrinfo)) + continue; + possibly_mark(fctx, addrinfo); + if (UNMARKED(addrinfo)) { + addrinfo->flags |= FCTX_ADDRINFO_MARK; + break; + } } - } - if (addrinfo != NULL) - break; - find = ISC_LIST_NEXT(find, publink); - if (find != fctx->altfind && find == NULL) - find = ISC_LIST_HEAD(fctx->altfinds); + if (addrinfo != NULL) + break; + find = ISC_LIST_NEXT(find, publink); + if (find != fctx->altfind && find == NULL) + find = ISC_LIST_HEAD(fctx->altfinds); + } while (find != fctx->altfind); } faddrinfo = addrinfo;