From: Mark Andrews Date: Mon, 12 Nov 2001 22:37:56 +0000 (+0000) Subject: pullup: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f30e1ea68c988b17e95ab1558084153374d4df95;p=thirdparty%2Fbind9.git pullup: 1118. [bug] On multithreaded servers, a race condition could cause an assertion failure in resolver.c during resolver shutdown. [RT #2029] --- diff --git a/CHANGES b/CHANGES index db7a77f3c15..7353d576122 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1118. [bug] On multithreaded servers, a race condition + could cause an assertion failure in resolver.c + during resolver shutdown. [RT #2029] + 1114. [port] Ignore more accept() errors. [RT #2021] 1111. [bug] Multithreaded servers could deadlock processing diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 1ac71d425aa..0831c619a9c 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.187.2.11 2001/07/11 01:23:56 gson Exp $ */ +/* $Id: resolver.c,v 1.187.2.12 2001/11/12 22:37:56 marka Exp $ */ #include @@ -1869,8 +1869,6 @@ fctx_doshutdown(isc_task_t *task, isc_event_t *event) { FCTXTRACE("doshutdown"); - fctx->attributes |= FCTX_ATTR_SHUTTINGDOWN; - /* * An fctx that is shutting down is no longer in ADDRWAIT mode. */ @@ -1895,6 +1893,8 @@ fctx_doshutdown(isc_task_t *task, isc_event_t *event) { LOCK(&res->buckets[bucketnum].lock); + fctx->attributes |= FCTX_ATTR_SHUTTINGDOWN; + INSIST(fctx->state == fetchstate_active || fctx->state == fetchstate_done); INSIST(fctx->want_shutdown); @@ -3381,6 +3381,10 @@ noanswer_response(fetchctx_t *fctx, dns_name_t *oqname) { type = rdataset->type; if (type == dns_rdatatype_sig) type = rdataset->covers; + if (((type == dns_rdatatype_ns || + type == dns_rdatatype_soa) && + !dns_name_issubdomain(qname, name))) + return (DNS_R_FORMERR); if (type == dns_rdatatype_ns) { /* * NS or SIG NS. @@ -3530,7 +3534,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);