2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Restored the "done" variable removed in 1.150 and made

the result code check after the loop deal with ISC_R_SUCCESS
instead.  The previous fix had the side effect of keeping multiple
answers to non-ANY queries, causing assertion failures in cache_name()
which is not prepared to deal with this situation
This commit is contained in:
Andreas Gustafsson
2000-07-24 20:10:26 +00:00
parent 8303a2a9ff
commit 6f12e3ca45

View File

@@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: resolver.c,v 1.150 2000/07/19 23:19:05 gson Exp $ */ /* $Id: resolver.c,v 1.151 2000/07/24 20:10:26 gson Exp $ */
#include <config.h> #include <config.h>
@@ -3286,7 +3286,7 @@ answer_response(fetchctx_t *fctx) {
qname = &fctx->name; qname = &fctx->name;
type = fctx->type; type = fctx->type;
result = dns_message_firstname(message, DNS_SECTION_ANSWER); result = dns_message_firstname(message, DNS_SECTION_ANSWER);
while (result == ISC_R_SUCCESS) { while (!done && result == ISC_R_SUCCESS) {
name = NULL; name = NULL;
dns_message_currentname(message, DNS_SECTION_ANSWER, &name); dns_message_currentname(message, DNS_SECTION_ANSWER, &name);
external = ISC_TF(!dns_name_issubdomain(name, &fctx->domain)); external = ISC_TF(!dns_name_issubdomain(name, &fctx->domain));
@@ -3297,12 +3297,20 @@ answer_response(fetchctx_t *fctx) {
found = ISC_FALSE; found = ISC_FALSE;
want_chaining = ISC_FALSE; want_chaining = ISC_FALSE;
aflag = 0; aflag = 0;
if (rdataset->type == type || if (rdataset->type == type) {
type == dns_rdatatype_any) {
/* /*
* We've found an ordinary answer. * We've found an ordinary answer.
*/ */
found = ISC_TRUE; found = ISC_TRUE;
done = ISC_TRUE;
aflag = DNS_RDATASETATTR_ANSWER;
} else if (type == dns_rdatatype_any) {
/*
* We've found an answer matching
* an ANY query. There may be
* more.
*/
found = ISC_TRUE;
aflag = DNS_RDATASETATTR_ANSWER; aflag = DNS_RDATASETATTR_ANSWER;
} else if (rdataset->type == dns_rdatatype_sig } else if (rdataset->type == dns_rdatatype_sig
&& rdataset->covers == type) { && rdataset->covers == type) {
@@ -3497,7 +3505,9 @@ answer_response(fetchctx_t *fctx) {
} }
result = dns_message_nextname(message, DNS_SECTION_ANSWER); result = dns_message_nextname(message, DNS_SECTION_ANSWER);
} }
if (result != ISC_R_NOMORE) if (result == ISC_R_NOMORE)
result = ISC_R_SUCCESS;
if (result != ISC_R_SUCCESS)
return (result); return (result);
/* /*
@@ -3584,10 +3594,10 @@ answer_response(fetchctx_t *fctx) {
} }
result = dns_message_nextname(message, DNS_SECTION_AUTHORITY); result = dns_message_nextname(message, DNS_SECTION_AUTHORITY);
} }
if (result != ISC_R_NOMORE) if (result == ISC_R_NOMORE)
return (result); result = ISC_R_SUCCESS;
return (ISC_R_SUCCESS); return (result);
} }
static void static void