BIND 10 trac1579, updated. dfd2aeefef39f064183c84c23451637247e32399 [1579] more editorial and style (guideline) fixes

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Mar 23 01:07:59 UTC 2012


The branch, trac1579 has been updated
       via  dfd2aeefef39f064183c84c23451637247e32399 (commit)
       via  1c57fb2350d9b8440ae4cf50a94be7c61cc462b0 (commit)
       via  8c55200c178773691ace2785240bfc65f4e351a9 (commit)
       via  ae40f56b7e12776479161c7d7a2d6616fae09850 (commit)
       via  dd8d9d4ab35db98d5269dd9c0728a5af6e748f1a (commit)
      from  29e01b55a5acd72e651c2b2bd5cc63ffe8b21da8 (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 dfd2aeefef39f064183c84c23451637247e32399
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Mar 22 17:52:23 2012 -0700

    [1579] more editorial and style (guideline) fixes

commit 1c57fb2350d9b8440ae4cf50a94be7c61cc462b0
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Mar 22 17:52:10 2012 -0700

    [1579] more editorial fixes

commit 8c55200c178773691ace2785240bfc65f4e351a9
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Mar 22 17:35:07 2012 -0700

    [1579] constified is_nsec3

commit ae40f56b7e12776479161c7d7a2d6616fae09850
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Mar 22 17:18:52 2012 -0700

    [1579] suggested change for an awkward comment line:
    
    - s/NSEC3PARAMETER/NSEC3PARAM/
    - "definitely" is too strong in this context
    - add a space after a comma
    - "zonefile" is awkward (there's no "zonefile" in this context)
    - "NSEC3 method" is an awkward term
    - "this zone signature" is also awkward

commit dd8d9d4ab35db98d5269dd9c0728a5af6e748f1a
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Mar 22 17:04:38 2012 -0700

    [1579] editorial: removed spaces at EOL; folded long lines, () after return.

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

Summary of changes:
 src/lib/datasrc/database.cc                |   46 +++++++++++++--------------
 src/lib/datasrc/tests/database_unittest.cc |   22 ++++++-------
 2 files changed, 32 insertions(+), 36 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 83d66ce..c2bc47a 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -907,54 +907,52 @@ DatabaseClient::Finder::findInternal(const Name& name, const RRType& type,
     const FoundRRsets found = getRRsets(name.toText(), final_types,
                                         !is_origin, NULL,
                                         type == RRType::ANY());
-    // verify whether the zonefile is signed by NSEC3 method
-    // If the NSEC3PARAMETER type exists in the zonefile,NSEC3 is definitly used
-    // in this zone signature.
-    bool is_nsec3 = false;
-    const FoundRRsets nsec3_found = getRRsets(origin_.toText(), NSEC3PARAM_TYPES(),
-                                              false);
+
+    // If an NSEC3PARAM RR exists at the zone apex, it's quite likely that
+    // the zone is signed with NSEC3.  (If not the zone is more or less broken,
+    // but it's caller's responsibility how to handle such cases).
+    const FoundRRsets nsec3_found = getRRsets(origin_.toText(),
+                                              NSEC3PARAM_TYPES(), false);
     const FoundIterator nfi(nsec3_found.second.find(RRType::NSEC3PARAM()));
-    if (nfi != nsec3_found.second.end()) {
-        is_nsec3 = true;
-    }
+    const bool is_nsec3 = (nfi != nsec3_found.second.end());
     if (found.first) {
         // Something found at the domain name.  Look into it further to get
         // the final result.
-        if (true == is_nsec3) {
-            const ZoneFinder::ResultContext result_context = 
+        if (is_nsec3) {
+            const ZoneFinder::ResultContext result_context =
                 findOnNameResult(name, type, options, is_origin, found, NULL,
                                  target);
-            if ((result_context.code & NXRRSET) ||
-                (result_context.flags & RESULT_WILDCARD)) {
+            if ((result_context.code & NXRRSET) != 0 ||
+                (result_context.flags & RESULT_WILDCARD) != 0) {
                 return (ZoneFinder::ResultContext(result_context.code,
                                                   result_context.rrset,
                                                   (result_context.flags |
                                                    RESULT_NSEC3_SIGNED)));
             } else {
-                return result_context; 
+                return (result_context);
             }
         } else {
-            return (findOnNameResult(name, type, options, is_origin, found, NULL,
-                                     target));
+            return (findOnNameResult(name, type, options, is_origin, found,
+                                     NULL, target));
         }
     } else {
         // Did not find anything at all at the domain name, so check for
         // subdomains or wildcards.
-        if (true == is_nsec3) {
-            // NSEC3 is used for this zonefile
-            const ZoneFinder::ResultContext result_context = 
+        if (is_nsec3) {
+            // NSEC3 is used for this zone
+            const ZoneFinder::ResultContext result_context =
                 findNoNameResult(name, type, options, dresult, target);
-            if ((result_context.code & (NXRRSET | NXDOMAIN)) ||
-                (result_context.flags & RESULT_WILDCARD)){
+            if ((result_context.code & (NXRRSET | NXDOMAIN)) != 0 ||
+                (result_context.flags & RESULT_WILDCARD) != 0) {
                 // NXRRSET NXDOMAIN and wildcard should set RESULT_NSEC3_SIGNED
-                return (ZoneFinder::ResultContext(result_context.code, 
+                return (ZoneFinder::ResultContext(result_context.code,
                                                   result_context.rrset,
                                                   (result_context.flags |
                                                    RESULT_NSEC3_SIGNED)));
             } else {
-                return result_context;
+                return (result_context);
             }
-        } else { 
+        } else {
             return (findNoNameResult(name, type, options, dresult, target));
         }
     }
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index 48999a3..1dcd615 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -2283,9 +2283,9 @@ TYPED_TEST(DatabaseClientTest, wildcardNXRRSET_NSEC) {
 
 TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
     // ZoneFinder::find() for negative cases should show whether the zone is
-    // signed by NSEC or NSEC3,that is good for upper layer caller.
+    // signed with NSEC or NSEC3, that is good for upper layer caller.
 
-    // First off, everything should be okay if no NSEC3PARAM rrset 
+    // First off, everything should be okay if no NSEC3PARAM rrset
     this->updater_ = this->client_->getUpdater(this->zname_, false);
     this->expected_rdatas_.clear();
     this->expected_sig_rdatas_.clear();
@@ -2320,11 +2320,12 @@ TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
                this->empty_rdatas_,
                ZoneFinder::RESULT_WILDCARD);
 
-    // Then,If NSEC3PARAM exists in zonefile,the flags of result should 
+    // Then, if NSEC3PARAM exists at the origin, the flags of result should
     // contain RESULT_NSEC3_SIGNED flag when NXDOMAIN NXRRSET or wildcard
-    
-    // Add NSEC3PARAM RRSET to zonefile. It looks weird if zonefile only have 
-    // NSEC3PARM RRSET, but it is okay for unit test.
+
+    // Add NSEC3PARAM RRSET at the apex of the zone. It looks weird if the
+    // zone only has NSEC3PARM RRset (but no NSEC3s), but it is okay for unit
+    // test.
     this->rrset_.reset(new RRset(this->zname_, this->qclass_,
                                 isc::dns::RRType::NSEC3PARAM(),
                                 this->rrttl_));
@@ -2347,11 +2348,9 @@ TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
     this->expected_sig_rdatas_.clear();
     doFindTest(this->updater_->getFinder(),
                isc::dns::Name("www.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(),
-               this->rrttl_,
-               ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_NSEC3_SIGNED);
+               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), this->rrttl_,
+               ZoneFinder::NXRRSET, this->expected_rdatas_,
+               this->expected_sig_rdatas_, ZoneFinder::RESULT_NSEC3_SIGNED);
     // check flags if wildcard matches
     this->expected_rdatas_.push_back("192.0.2.5");
     this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
@@ -2371,7 +2370,6 @@ TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
                this->rrttl_, ZoneFinder::NXRRSET, this->expected_rdatas_,
                this->empty_rdatas_,
                ZoneFinder::RESULT_WILDCARD | ZoneFinder::RESULT_NSEC3_SIGNED);
-
 }
 
 TYPED_TEST(DatabaseClientTest, NXDOMAIN_NSEC) {



More information about the bind10-changes mailing list