]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
change #1679 still left case where address could not be tried.
authorMark Andrews <marka@isc.org>
Sun, 27 Jun 2004 01:21:41 +0000 (01:21 +0000)
committerMark Andrews <marka@isc.org>
Sun, 27 Jun 2004 01:21:41 +0000 (01:21 +0000)
fix loop termination condition to ensure that all finds are tried.

lib/dns/resolver.c

index 3f210f586198db90ec197e45bdc658c29ed10f90..0adba77421d2cb357d77ddec41bb9b38d832248f 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.290 2004/06/25 04:39:19 marka Exp $ */
+/* $Id: resolver.c,v 1.291 2004/06/27 01:21:41 marka Exp $ */
 
 #include <config.h>
 
@@ -2059,7 +2059,7 @@ possibly_mark(fetchctx_t *fctx, dns_adbaddrinfo_t *addr)
 
 static inline dns_adbaddrinfo_t *
 fctx_nextaddress(fetchctx_t *fctx) {
-       dns_adbfind_t *find;
+       dns_adbfind_t *find, *start;
        dns_adbaddrinfo_t *addrinfo;
        dns_adbaddrinfo_t *faddrinfo;
 
@@ -2103,6 +2103,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
         */
        addrinfo = NULL;
        if (find != NULL) {
+               start = find;
                do {
                        for (addrinfo = ISC_LIST_HEAD(find->list);
                             addrinfo != NULL;
@@ -2120,7 +2121,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
                        find = ISC_LIST_NEXT(find, publink);
                        if (find != fctx->find && find == NULL)
                                find = ISC_LIST_HEAD(fctx->finds);
-               } while (find != fctx->find);
+               } while (find != start);
        }
 
        fctx->find = find;
@@ -2147,6 +2148,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
         */
        addrinfo = NULL;
        if (find != NULL) {
+               start = find;
                do {
                        for (addrinfo = ISC_LIST_HEAD(find->list);
                             addrinfo != NULL;
@@ -2164,7 +2166,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
                        find = ISC_LIST_NEXT(find, publink);
                        if (find != fctx->altfind && find == NULL)
                                find = ISC_LIST_HEAD(fctx->altfinds);
-               } while (find != fctx->altfind);
+               } while (find != start);
        }
 
        faddrinfo = addrinfo;