BIND 10 trac1805, updated. 32bb3f9e17a9c3c2bbc50b4239ee8463f9216299 [1805] minor optimization: check nsec_signed first in getClosestNSEC().

BIND 10 source code commits bind10-changes at lists.isc.org
Wed May 9 20:56:19 UTC 2012


The branch, trac1805 has been updated
       via  32bb3f9e17a9c3c2bbc50b4239ee8463f9216299 (commit)
       via  751e4b49ae09892db8e81f270014ad8190edca9a (commit)
      from  1322f10b28fb7ccbc69768c409ac36fe26ce0657 (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 32bb3f9e17a9c3c2bbc50b4239ee8463f9216299
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 9 13:54:03 2012 -0700

    [1805] minor optimization: check nsec_signed first in getClosestNSEC().
    
    in practice the DNSSEC option is provided in many cases, considering
    the common default behavior of widely deployed resolvers, while not many
    zones are actually not signed at all in the first place (much less whether
    it's NSEC or NSEC3).  so in many cases we should simply be able to stop the
    condition check with the nsec_signed.

commit 751e4b49ae09892db8e81f270014ad8190edca9a
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 9 13:51:45 2012 -0700

    [1805] added some more comments about node_path as requested in review.

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

Summary of changes:
 src/lib/datasrc/memory_datasrc.cc |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory_datasrc.cc b/src/lib/datasrc/memory_datasrc.cc
index 88a974c..1d026ca 100644
--- a/src/lib/datasrc/memory_datasrc.cc
+++ b/src/lib/datasrc/memory_datasrc.cc
@@ -212,8 +212,11 @@ public:
 
     // Identify the RBTree node that best matches the given name.
     // See implementation notes below.
+    //
     // The caller should pass an empty node_path, and it will contain the
-    // search context for possible later use at the caller side.
+    // search context (all ancestor nodes that the underlying RBTree search
+    // traverses, and how the search stops) for possible later use at the
+    // caller side.
     template <typename ResultType>
     ResultType findNode(const Name& name,
                         RBTreeNodeChain<Domain>& node_path,
@@ -248,7 +251,7 @@ ConstRBNodeRRsetPtr
 ZoneData::getClosestNSEC(RBTreeNodeChain<Domain>& node_path,
                          ZoneFinder::FindOptions options) const
 {
-    if ((options & ZoneFinder::FIND_DNSSEC) == 0 || !nsec_signed_) {
+    if (!nsec_signed_ || (options & ZoneFinder::FIND_DNSSEC) == 0) {
         return (ConstRBNodeRRsetPtr());
     }
 
@@ -1288,7 +1291,7 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
 
         // Get the node.  All other cases than an exact match are handled
         // in findNode().  We simply construct a result structure and return.
-        RBTreeNodeChain<Domain> node_path;
+        RBTreeNodeChain<Domain> node_path; // findNode will fill in this
         const ZoneData::FindNodeResult node_result =
             zone_data_->findNode<ZoneData::FindNodeResult>(name, node_path,
                                                            options);
@@ -1528,7 +1531,7 @@ addAdditional(RBNodeRRset* rrset, ZoneData* zone_data,
 {
     RdataIteratorPtr rdata_iterator = rrset->getRdataIterator();
     bool match_wild = false;    // will be true if wildcard match is found
-    RBTreeNodeChain<Domain> node_path;
+    RBTreeNodeChain<Domain> node_path;  // placeholder for findNode()
     for (; !rdata_iterator->isLast(); rdata_iterator->next()) {
         // For each domain name that requires additional section processing
         // in each RDATA, search the tree for the name and remember it if



More information about the bind10-changes mailing list