BIND 10 trac1177, updated. e9eb3b16a185becb8b68c0f603ea919e301a9127 [1177] NSEC in case of normal NXRRSET

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Sep 8 08:59:32 UTC 2011


The branch, trac1177 has been updated
       via  e9eb3b16a185becb8b68c0f603ea919e301a9127 (commit)
      from  2708caa4c3cb28141f8ac222421c487f21fc2bfb (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 e9eb3b16a185becb8b68c0f603ea919e301a9127
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu Sep 8 10:59:13 2011 +0200

    [1177] NSEC in case of normal NXRRSET

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

Summary of changes:
 src/lib/datasrc/database.cc                |   12 +++++++++++-
 src/lib/datasrc/tests/database_unittest.cc |    4 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 8571453..4832103 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -314,6 +314,7 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
     // NXDOMAIN and NXRRSET
     bool records_found = false;
     bool glue_ok(options & FIND_GLUE_OK);
+    bool dnssec_data(options & FIND_DNSSEC);
     isc::dns::RRsetPtr result_rrset;
     ZoneFinder::Result result_status = SUCCESS;
     FoundRRsets found;
@@ -387,7 +388,7 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
         // And we don't consider the NS in origin
 
         static WantedTypes final_types(empty_types + RRType::CNAME() +
-                                       RRType::NS());
+                                       RRType::NS() + RRType::NSEC());
         found = getRRsets(name, final_types + type, name != origin);
         records_found = found.first;
 
@@ -502,6 +503,15 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
                     }
                 }
             }
+        } else if (dnssec_data) {
+            // This is the "usual" NXRRSET case
+            // So in case they want DNSSEC, provide the NSEC
+            // (which should be available already here)
+            result_status = NXRRSET;
+            const FoundIterator nci(found.second.find(RRType::NSEC()));
+            if (nci != found.second.end()) {
+                result_rrset = nci->second;
+            }
         }
     }
 
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index 51397b4..4d0f955 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -1314,7 +1314,7 @@ TEST_F(DatabaseClientTest, NXRRSET_NSEC) {
                                    "20000201000000 12345 example.org. "
                                    "FAKEFAKEFAKE");
     doFindTest(finder, isc::dns::Name("www.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(),
+               isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
                isc::dns::RRTTL(3600),
                ZoneFinder::NXRRSET,
                expected_rdatas_, expected_sig_rdatas_, Name::ROOT_NAME(),
@@ -1335,7 +1335,7 @@ TEST_F(DatabaseClientTest, wildcardNXRRSET_NSEC) {
                                    "FAKEFAKEFAKE");
     // Note that the NSEC name should NOT be synthesized.
     doFindTest(finder, isc::dns::Name("a.wild.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(),
+               isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
                isc::dns::RRTTL(3600),
                ZoneFinder::NXRRSET,
                expected_rdatas_, expected_sig_rdatas_,




More information about the bind10-changes mailing list