From: Evan Hunt Date: Wed, 23 Dec 2009 23:43:01 +0000 (+0000) Subject: 2816. [bug] previous_closest_nsec() could fail to return X-Git-Tag: v9.4.3-P1~2^2~29 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=b09559fd36c5081ffaf58ab64bdef170c1a720f1;p=thirdparty%2Fbind9.git 2816. [bug] previous_closest_nsec() could fail to return data for NSEC3 nodes [RT #29730] --- diff --git a/CHANGES b/CHANGES index d4fba9d8c86..c8abbfdf7b0 100644 --- 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] diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 71d338d615f..978072f58a9 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -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);