BIND 10 trac2218_2, updated. 950c72ccede294b7692bb7bdb20ef1bc28c3cc76 [2218] Assert that ZoneNodes in NSEC3 tree contain NSEC3 RRType

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 21 03:46:11 UTC 2012


The branch, trac2218_2 has been updated
       via  950c72ccede294b7692bb7bdb20ef1bc28c3cc76 (commit)
      from  eee7c05de1c33b0d932ebbaca4370129d315e0ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 950c72ccede294b7692bb7bdb20ef1bc28c3cc76
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri Sep 21 09:15:16 2012 +0530

    [2218] Assert that ZoneNodes in NSEC3 tree contain NSEC3 RRType

-----------------------------------------------------------------------

Summary of changes:
 src/lib/datasrc/memory/zone_finder.cc |   31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/zone_finder.cc b/src/lib/datasrc/memory/zone_finder.cc
index cdbdb07..a91ffe5 100644
--- a/src/lib/datasrc/memory/zone_finder.cc
+++ b/src/lib/datasrc/memory/zone_finder.cc
@@ -686,13 +686,21 @@ InMemoryZoneFinder::findNSEC3(const isc::dns::Name& name, bool recursive) {
 
         if (result == ZoneTree::EXACTMATCH) {
             // We found an exact match.
-            RdataSet* rdataset = node->getData();
+            const RdataSet* rdataset = node->getData();
+            assert(rdataset != NULL);
+            assert(rdataset->type == RRType::NSEC3());
+
             ConstRRsetPtr closest = createTreeNodeRRset(node, rdataset,
                                                         getClass());
-            ConstRRsetPtr next = (covering_node == NULL) ?
-                ConstRRsetPtr() :
-                createTreeNodeRRset(covering_node, covering_node->getData(),
-                                    getClass());
+            ConstRRsetPtr next;
+            if (covering_node != NULL) {
+                rdataset = covering_node->getData();
+                assert(rdataset != NULL);
+                assert(rdataset->type == RRType::NSEC3());
+
+                next = createTreeNodeRRset(covering_node, rdataset,
+                                           getClass());
+            }
 
             LOG_DEBUG(logger, DBG_TRACE_BASIC,
                       DATASRC_MEM_FINDNSEC3_MATCH).arg(name).arg(labels).
@@ -724,10 +732,15 @@ InMemoryZoneFinder::findNSEC3(const isc::dns::Name& name, bool recursive) {
             }
 
             if (!recursive) {   // in non recursive mode, we are done.
-                ConstRRsetPtr closest = (covering_node == NULL) ?
-                    ConstRRsetPtr() :
-                    createTreeNodeRRset(covering_node, covering_node->getData(),
-                                        getClass());
+                ConstRRsetPtr closest;
+                if (covering_node != NULL) {
+                    const RdataSet* rdataset = covering_node->getData();
+                    assert(rdataset != NULL);
+                    assert(rdataset->type == RRType::NSEC3());
+
+                    closest = createTreeNodeRRset(covering_node, rdataset,
+                                                  getClass());
+                }
 
                 if (closest) {
                     LOG_DEBUG(logger, DBG_TRACE_BASIC,



More information about the bind10-changes mailing list