]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Mon, 12 Nov 2001 22:37:56 +0000 (22:37 +0000)
committerMark Andrews <marka@isc.org>
Mon, 12 Nov 2001 22:37:56 +0000 (22:37 +0000)
1118.   [bug]           On multithreaded servers, a race condition
                        could cause an assertion failure in resolver.c
                        during resolver shutdown. [RT #2029]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index db7a77f3c153c83791112680eac8ff49f2b94306..7353d5761222da129e03959599c00251cc78d9a7 100644 (file)
--- 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
index 1ac71d425aad433fd971f19a942ff0cb8e1cc720..0831c619a9c6010145b614c4b9cb085ed519edda 100644 (file)
@@ -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 <config.h>
 
@@ -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);