]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2197. [bug] Add INSIST to catch negative responses which are
authorMark Andrews <marka@isc.org>
Mon, 18 Jun 2007 02:34:21 +0000 (02:34 +0000)
committerMark Andrews <marka@isc.org>
Mon, 18 Jun 2007 02:34:21 +0000 (02:34 +0000)
                        not setting the event result code appropriately.
                        [RT #16909]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 8e363749f7ff2390ee6106949c56f7856f1dd7ee..47afab5d5975fc961e48e70251f6ac959e5ff42f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
+2197.  [bug]           Add INSIST to catch negative responses which are
+                       not setting the event result code appropriately.
+                       [RT #16909]
+
 2196.  [port]          win32: yield processor while waiting for once to
-                       to complete. [RT16958]
+                       to complete. [RT #16958]
 
 2195.  [func]          dnssec-keygen now defaults to nametype "ZONE"
                        when generating DNSKEYs. [RT #16954]
index 4206209e7d0e85858ea73a789b78687080cea1c8..e5739834346145c8dffee39821aee5b010fdf66e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.347 2007/05/21 02:03:22 marka Exp $ */
+/* $Id: resolver.c,v 1.348 2007/06/18 02:34:21 marka Exp $ */
 
 /*! \file */
 
@@ -823,6 +823,15 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
                       fctx->type == dns_rdatatype_any ||
                       fctx->type == dns_rdatatype_rrsig ||
                       fctx->type == dns_rdatatype_sig);
+               
+               /*
+                * Negative results must be indicated in event->result.
+                */
+               if (dns_rdataset_isassociated(event->rdataset) &&
+                   event->rdataset->type == dns_rdatatype_none) {
+                       INSIST(event->result == DNS_R_NCACHENXDOMAIN ||
+                              event->result == DNS_R_NCACHENXRRSET);
+               }
 
                isc_task_sendanddetach(&task, ISC_EVENT_PTR(&event));
                count++;