2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 15:45:25 +00:00

change #1679 still left case where address could not be tried.

fix loop termination condition to ensure that all finds are tried.
This commit is contained in:
Mark Andrews
2004-06-27 01:21:41 +00:00
parent e30e7913c9
commit a73a3b2a04

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * 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> #include <config.h>
@@ -2059,7 +2059,7 @@ possibly_mark(fetchctx_t *fctx, dns_adbaddrinfo_t *addr)
static inline dns_adbaddrinfo_t * static inline dns_adbaddrinfo_t *
fctx_nextaddress(fetchctx_t *fctx) { fctx_nextaddress(fetchctx_t *fctx) {
dns_adbfind_t *find; dns_adbfind_t *find, *start;
dns_adbaddrinfo_t *addrinfo; dns_adbaddrinfo_t *addrinfo;
dns_adbaddrinfo_t *faddrinfo; dns_adbaddrinfo_t *faddrinfo;
@@ -2103,6 +2103,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
*/ */
addrinfo = NULL; addrinfo = NULL;
if (find != NULL) { if (find != NULL) {
start = find;
do { do {
for (addrinfo = ISC_LIST_HEAD(find->list); for (addrinfo = ISC_LIST_HEAD(find->list);
addrinfo != NULL; addrinfo != NULL;
@@ -2120,7 +2121,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
find = ISC_LIST_NEXT(find, publink); find = ISC_LIST_NEXT(find, publink);
if (find != fctx->find && find == NULL) if (find != fctx->find && find == NULL)
find = ISC_LIST_HEAD(fctx->finds); find = ISC_LIST_HEAD(fctx->finds);
} while (find != fctx->find); } while (find != start);
} }
fctx->find = find; fctx->find = find;
@@ -2147,6 +2148,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
*/ */
addrinfo = NULL; addrinfo = NULL;
if (find != NULL) { if (find != NULL) {
start = find;
do { do {
for (addrinfo = ISC_LIST_HEAD(find->list); for (addrinfo = ISC_LIST_HEAD(find->list);
addrinfo != NULL; addrinfo != NULL;
@@ -2164,7 +2166,7 @@ fctx_nextaddress(fetchctx_t *fctx) {
find = ISC_LIST_NEXT(find, publink); find = ISC_LIST_NEXT(find, publink);
if (find != fctx->altfind && find == NULL) if (find != fctx->altfind && find == NULL)
find = ISC_LIST_HEAD(fctx->altfinds); find = ISC_LIST_HEAD(fctx->altfinds);
} while (find != fctx->altfind); } while (find != start);
} }
faddrinfo = addrinfo; faddrinfo = addrinfo;