]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2816. [bug] previous_closest_nsec() could fail to return
authorEvan Hunt <each@isc.org>
Wed, 23 Dec 2009 23:43:01 +0000 (23:43 +0000)
committerEvan Hunt <each@isc.org>
Wed, 23 Dec 2009 23:43:01 +0000 (23:43 +0000)
data for NSEC3 nodes [RT #29730]

CHANGES
lib/dns/rbtdb.c

diff --git a/CHANGES b/CHANGES
index d4fba9d8c86237c31e78a6c633a5874bf40074aa..c8abbfdf7b0bd20fa6902068bf4167674423602b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2816.  [bug]           previous_closest_nsec() could fail to return
+                       data for NSEC3 nodes [RT #29730]
+
 2815.  [bug]           Exclusively lock the task when freezing a zone.
                        [RT #19838]
 
index 71d338d615f3056dba61d5051ef0aec6071e4034..978072f58a91de8042df6bf427da44fa5fe63d3c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.292 2009/11/26 23:48:14 tbox Exp $ */
+/* $Id: rbtdb.c,v 1.293 2009/12/23 23:43:01 each Exp $ */
 
 /*! \file */
 
@@ -3235,8 +3235,16 @@ previous_closest_nsec(dns_rdatatype_t type, rbtdb_search_t *search,
        dns_rbtnode_t *nsecnode;
        isc_result_t result;
 
-       if (type == dns_rdatatype_nsec3)
-               return (dns_rbtnodechain_prev(&search->chain, NULL, NULL));
+       if (type == dns_rdatatype_nsec3) {
+               result = dns_rbtnodechain_prev(&search->chain, NULL, NULL);
+               if (result != ISC_R_SUCCESS && result != DNS_R_NEWORIGIN)
+                       return (result);
+               result = dns_rbtnodechain_current(&search->chain, name, origin,
+                                                 nodep);
+               if (result != ISC_R_SUCCESS)
+                       return (result);
+               return (ISC_R_SUCCESS);
+       }
 
        dns_fixedname_init(&ftarget);
        target = dns_fixedname_name(&ftarget);