BIND 10 master, updated. 93eddf78d2db40f314323dc708252c87ed846a48 [2504] Add ChangeLog entry

BIND 10 source code commits bind10-changes at lists.isc.org
Sun Dec 9 14:23:51 UTC 2012


The branch, master has been updated
       via  93eddf78d2db40f314323dc708252c87ed846a48 (commit)
       via  835553eb309d100b062051f7ef18422d2e8e3ae4 (commit)
       via  a6b558c0d09f1812f347497857ab8aa42b33b0f7 (commit)
       via  06eeaf025beb42ff26032d79b325718c97ed4550 (commit)
       via  4a9ea530abdc7aff1f58f6c92c281e5ed35d6741 (commit)
       via  cbf6d3808e596d35fc8c83a5f35e13dfb4c2449b (commit)
      from  cb4d9b014ea7d80efadfbdbfe2d1ab1dbde68bc1 (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 93eddf78d2db40f314323dc708252c87ed846a48
Author: Mukund Sivaraman <muks at isc.org>
Date:   Sun Dec 9 19:53:32 2012 +0530

    [2504] Add ChangeLog entry

commit 835553eb309d100b062051f7ef18422d2e8e3ae4
Merge: a6b558c cb4d9b0
Author: Mukund Sivaraman <muks at isc.org>
Date:   Sun Dec 9 18:33:06 2012 +0530

    Merge branch 'master' into trac2504

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

Summary of changes:
 ChangeLog                                          |    5 ++++
 src/lib/datasrc/memory/zone_finder.cc              |   13 ++++++++--
 .../datasrc/tests/memory/testdata/2504-test.zone   |   10 ++++++++
 src/lib/datasrc/tests/memory/testdata/Makefile.am  |    2 ++
 .../datasrc/tests/memory/zone_finder_unittest.cc   |   25 ++++++++++++++++++++
 5 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 src/lib/datasrc/tests/memory/testdata/2504-test.zone

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 32b9227..67fbc1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+519.	[bug]		muks
+	Fixed a problem in inmem NSEC lookup which caused assert failures
+	in some cases.
+	(Trac #2504, git 835553eb309d100b062051f7ef18422d2e8e3ae4)
+
 518.	[func]		stephen
 	Extend DHCP MySQL backend to handle IPv4 addresses.
 	(Trac #2404, git ce7db48d3ff5d5aad12b1da5e67ae60073cb2607)
diff --git a/src/lib/datasrc/memory/zone_finder.cc b/src/lib/datasrc/memory/zone_finder.cc
index 4240c21..7f57d8e 100644
--- a/src/lib/datasrc/memory/zone_finder.cc
+++ b/src/lib/datasrc/memory/zone_finder.cc
@@ -305,8 +305,16 @@ getClosestNSEC(const ZoneData& zone_data,
     }
 
     const ZoneNode* prev_node;
-    while ((prev_node = zone_data.getZoneTree().previousNode(node_path))
-           != NULL) {
+    if (node_path.getLastComparisonResult().getRelation() ==
+        NameComparisonResult::SUBDOMAIN) {
+         // In case the search ended as a sub-domain, the previous node
+         // is already at the top of node_path.
+         prev_node = node_path.getLastComparedNode();
+    } else {
+         prev_node = zone_data.getZoneTree().previousNode(node_path);
+    }
+
+    while (prev_node != NULL) {
         if (!prev_node->isEmpty()) {
             const RdataSet* found =
                 RdataSet::find(prev_node->getData(), RRType::NSEC());
@@ -314,6 +322,7 @@ getClosestNSEC(const ZoneData& zone_data,
                 return (ConstNodeRRset(prev_node, found));
             }
         }
+        prev_node = zone_data.getZoneTree().previousNode(node_path);
     }
     // This must be impossible and should be an internal bug.
     // See the description at the method declaration.
diff --git a/src/lib/datasrc/tests/memory/testdata/2504-test.zone b/src/lib/datasrc/tests/memory/testdata/2504-test.zone
new file mode 100644
index 0000000..bbbcb83
--- /dev/null
+++ b/src/lib/datasrc/tests/memory/testdata/2504-test.zone
@@ -0,0 +1,10 @@
+example.com.	3600	IN	SOA	ns.example.com. admin.example.com. 1234 3600 1800 2419200 7200
+example.com.	3600	IN	RRSIG	SOA 5 2 3600 20130104152459 20121207152459 5196 example.com. ijAvh4ZzAfMCKKWN64aR5CWaHYTAvhJjgBLV+1/RFPG3150DwDr9EI0bCdVyRIMDDLOeQnn0N70rtc051rA2pJVNpEzG2hPIy3Yd2kDsbFBn0atiz3rvjpRLcmmWWYoZihpkFwKRxD41OzJPLg83/yJr1nAu3qSQXh4LmuNfgwI=
+example.com.	3600	IN	A	192.0.2.1
+example.com.	3600	IN	RRSIG	A 5 2 3600 20130104152459 20121207152459 5196 example.com. XnVKYuSH+BANWiULSJAk6wmwnba8hUS9j2cgrCMFcn43XlAUCCNigoMCWhaGbsssMaOyjdwfL3sQZr/NHaQ0ITSL8IZj7t8rOiCvCrUAktuG5UuHmHET6XKPkf03JaoPXIzO9smBqvjFHz1HsuPGxwGh8ztY0p291iXk0zbRwc8=
+example.com.	3600	IN	NS	example.com.
+example.com.	3600	IN	RRSIG	NS 5 2 3600 20130104152459 20121207152459 5196 example.com. W5v7dr/WV8FGdxWFS0h1crd1MRxkSrkcmcAs7CT0+uhmVvbx06PsBxGRuCHyL8Y5NimsMs2RLjhkUkJw1+aSLVtTlbC8Pg5dFDK3bGkzBEq3wRcIXf5bM2Lf+l/cWxGY0NgR1Wrq0ckXsnFxegGm9G3OtpCZgTv0L+9cCO4MS7c=
+example.com.	3600	IN	DNSKEY	256 3 5 AwEAAZIOhUpUld/OBPeNJ26O1twKj3fRLPt4X8H6N01t4s+VT5v9jaCnCVX4O1LbALdJUv5uPwL4gy4qvf+7Z3Xanp7QCZ5i7ivS1qfiz2tfacXwtVv4aI4EqS7deYN6yD4S/vIpwW+2FoqUWhQtdhC68ex1YfjeEI+CUbAKlF5XgQR5 ;{id = 5196 (zsk), size = 1024b}
+example.com.	3600	IN	RRSIG	DNSKEY 5 2 3600 20130104152459 20121207152459 5196 example.com. OiN+DBuEDnyEmMe0Qa4MN4SIJ71e+INNhOvoGBpWARiWu83QlPkoJhdU1GADBaanYdFL8UI0os6w2dkwp4aghChD+KWO40NuhUY2LrEUS2jbO3hEcCT3/acaVyucwVv1FjfC4d561Lkfnh8DM9nk5i75IeWVLklMqret1t/f0uY=
+example.com.	7200	IN	NSEC	example.com. A NS SOA RRSIG NSEC DNSKEY
+example.com.	7200	IN	RRSIG	NSEC 5 2 7200 20130104152459 20121207152459 5196 example.com. P4eCHTNJImfwQ+wLa3jeySkVeJnzCmb4zFUDQEZIk3GSjLGUHZhHswqSAhpgevx6ZNX/pOqN/Dybf9oadFCZXyoMQDijP02LcDEl4X1ccNiakg6i/9RG9PcEx5ZWJlCFAJ0tOhp1kauZu/HUlkscTAVgBRud0qEclWJacH1k80E=
diff --git a/src/lib/datasrc/tests/memory/testdata/Makefile.am b/src/lib/datasrc/tests/memory/testdata/Makefile.am
index dddbf0a..d99872c 100644
--- a/src/lib/datasrc/tests/memory/testdata/Makefile.am
+++ b/src/lib/datasrc/tests/memory/testdata/Makefile.am
@@ -29,3 +29,5 @@ EXTRA_DIST += example.org-rrsigs.zone
 EXTRA_DIST += example.org-wildcard-dname.zone
 EXTRA_DIST += example.org-wildcard-ns.zone
 EXTRA_DIST += example.org-wildcard-nsec3.zone
+
+EXTRA_DIST += 2504-test.zone
diff --git a/src/lib/datasrc/tests/memory/zone_finder_unittest.cc b/src/lib/datasrc/tests/memory/zone_finder_unittest.cc
index f112119..510e39f 100644
--- a/src/lib/datasrc/tests/memory/zone_finder_unittest.cc
+++ b/src/lib/datasrc/tests/memory/zone_finder_unittest.cc
@@ -13,6 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include "memory_segment_test.h"
+#include "zone_table_segment_test.h"
 
 // NOTE: this faked_nsec3 inclusion (and all related code below)
 // was ported during #2109 for the convenience of implementing #2218
@@ -25,7 +26,10 @@
 #include <datasrc/memory/zone_finder.h>
 #include <datasrc/memory/zone_data_updater.h>
 #include <datasrc/memory/rdata_serialization.h>
+#include <datasrc/memory/zone_table_segment.h>
+#include <datasrc/memory/memory_client.h>
 #include <datasrc/data_source.h>
+#include <datasrc/client.h>
 #include <testutils/dnsmessage_test.h>
 
 #include <boost/foreach.hpp>
@@ -1426,6 +1430,27 @@ TEST_F(InMemoryZoneFinderTest, findOrphanRRSIG) {
              ZoneFinder::DELEGATION, true, ns_rrset);
 }
 
+// \brief testcase for #2504 (Problem in inmem NSEC denial of existence
+// handling)
+TEST_F(InMemoryZoneFinderTest, NSECNonExistentTest) {
+    shared_ptr<ZoneTableSegment> ztable_segment(
+         new ZoneTableSegmentTest(class_, mem_sgmt_));
+    InMemoryClient client(ztable_segment, class_);
+    Name name("example.com.");
+
+    client.load(name, TEST_DATA_DIR "/2504-test.zone");
+    DataSourceClient::FindResult result(client.findZone(name));
+
+    // Check for a non-existing name
+    Name search_name("nonexist.example.com.");
+    ZoneFinderContextPtr find_result(
+        result.zone_finder->find(search_name,
+                                 RRType::A(), ZoneFinder::FIND_DNSSEC));
+    // We don't find the domain, but find() must complete (not throw or
+    // assert).
+    EXPECT_EQ(ZoneFinder::NXDOMAIN, find_result->code);
+}
+
 /// \brief NSEC3 specific tests fixture for the InMemoryZoneFinder class
 class InMemoryZoneFinderNSEC3Test : public InMemoryZoneFinderTest {
 public:



More information about the bind10-changes mailing list