BIND 10 trac1802, updated. 37227b85bf18cf42bcc08bacedbe86bbe7bf6cfc [1802] Set the RESULT_NSEC_SIGNED flag in in-memory

BIND 10 source code commits bind10-changes at lists.isc.org
Thu May 3 11:23:12 UTC 2012


The branch, trac1802 has been updated
       via  37227b85bf18cf42bcc08bacedbe86bbe7bf6cfc (commit)
       via  1ff3eb19126e4c7a43a6f6b64fef46590f462fb8 (commit)
      from  156ace04dc1267c73f5e58006dc35fb0d3788c86 (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 37227b85bf18cf42bcc08bacedbe86bbe7bf6cfc
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu May 3 13:19:52 2012 +0200

    [1802] Set the RESULT_NSEC_SIGNED flag in in-memory
    
    When we return a negative answer or wildcard, we return
    RESULT_NSEC_SIGNED for NSEC signed zones, similarly to NSEC3-signed
    ones.

commit 1ff3eb19126e4c7a43a6f6b64fef46590f462fb8
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu May 3 13:13:48 2012 +0200

    [1802] Set the NSEC flag on add
    
    Not tested in any way now yet, this is private data structure. It is not
    yet used, so the behavior is not changed.

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

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

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory_datasrc.cc b/src/lib/datasrc/memory_datasrc.cc
index c19d5ae..ea35cfa 100644
--- a/src/lib/datasrc/memory_datasrc.cc
+++ b/src/lib/datasrc/memory_datasrc.cc
@@ -120,7 +120,11 @@ typedef NSEC3Map::value_type NSEC3Pair;
 // Actual zone data: Essentially a set of zone's RRs.  This is defined as
 // a separate structure so that it'll be replaceable on reload.
 struct ZoneData {
-    ZoneData(const Name& origin) : domains_(true), origin_data_(NULL) {
+    ZoneData(const Name& origin) :
+        domains_(true),
+        origin_data_(NULL),
+        nsec_signed_(false)
+    {
         // We create the node for origin (it needs to exist anyway in future)
         domains_.insert(origin, &origin_data_);
         DomainPtr origin_domain(new Domain);
@@ -170,6 +174,7 @@ public:
         const scoped_ptr<NSEC3Hash> hash_; // hash parameter/calculator
     };
     scoped_ptr<NSEC3Data> nsec3_data_; // non NULL only when it's NSEC3 signed
+    bool nsec_signed_; // True if there's at least one NSEC record
 
     // This templated structure encapsulates the find result of findNode()
     // method (also templated) below.
@@ -1162,6 +1167,10 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
                     isc_throw(AddError, "NSEC3PARAM with inconsistent "
                               "parameters: " << rrset->toText());
                 }
+            } else if (rrset->getType() == RRType::NSEC()) {
+                // If it is NSEC signed zone, so we put a flag there
+                // (flag is enough)
+                zone_data.nsec_signed_ = true;
             }
             return (result::SUCCESS);
         } else {
@@ -1206,9 +1215,13 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
         if (wild) {
             flags = flags | RESULT_WILDCARD;
         }
-        if ((code == NXRRSET || code == NXDOMAIN || wild) &&
-            zone_data_->nsec3_data_) {
-            flags = flags | RESULT_NSEC3_SIGNED;
+        if (code == NXRRSET || code == NXDOMAIN || wild) {
+            if (zone_data_->nsec3_data_) {
+                flags = flags | RESULT_NSEC3_SIGNED;
+            }
+            if (zone_data_->nsec_signed_) {
+                flags = flags | RESULT_NSEC_SIGNED;
+            }
         }
         return (RBNodeResultContext(code, rrset, flags, node));
     }



More information about the bind10-changes mailing list