From 13f2c161db9079da402a50f50192eecd7dd651f5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 10 Oct 2001 04:11:32 +0000 Subject: [PATCH] 1039. [bug] We cached an incorrect negative response if there were CNAMES in the answer section. [RT#1862] --- CHANGES | 2 ++ lib/dns/resolver.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index a63c112862..6e32e150e6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +1039. [bug] We cached an incorrect negative response if there were + CNAMES in the answer section. [RT#1862] 1038. [bug] In servers configured with a tkey-domain option, TKEY queries with an owner name other than the root diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 2bfbc60cd5..0f8dc05f05 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.225 2001/10/09 08:03:32 marka Exp $ */ +/* $Id: resolver.c,v 1.226 2001/10/10 04:11:32 marka Exp $ */ #include @@ -3107,6 +3107,12 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) { name = &fctx->name; node = NULL; + /* + * XXXMPA remove when we follow cnames and adjust the setting + * of FCTX_ATTR_WANTNCACHE in noanswer_response(). + */ + INSIST(fctx->rmessage->counts[DNS_SECTION_ANSWER] == 0); + /* * Is DNSSEC validation required for this name? */ @@ -3627,7 +3633,7 @@ noanswer_response(fetchctx_t *fctx, dns_name_t *oqname, if (ns_name != NULL) ns_name->attributes &= ~DNS_NAMEATTR_CACHE; - if (negative_response) + if (negative_response && oqname == NULL) fctx->attributes |= FCTX_ATTR_WANTNCACHE; return (ISC_R_SUCCESS);