BIND 10 master, updated. d6d267370155e3feeaa108af1d05931afac1f787 Merge #1802
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri May 4 07:42:36 UTC 2012
The branch, master has been updated
via d6d267370155e3feeaa108af1d05931afac1f787 (commit)
via 37227b85bf18cf42bcc08bacedbe86bbe7bf6cfc (commit)
via 1ff3eb19126e4c7a43a6f6b64fef46590f462fb8 (commit)
via 156ace04dc1267c73f5e58006dc35fb0d3788c86 (commit)
from 5fb18596288d2eae586cd01da0b27f329fb4e155 (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 d6d267370155e3feeaa108af1d05931afac1f787
Merge: 5fb18596288d2eae586cd01da0b27f329fb4e155 37227b85bf18cf42bcc08bacedbe86bbe7bf6cfc
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri May 4 09:06:02 2012 +0200
Merge #1802
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory_datasrc.cc | 21 +++++++++--
src/lib/datasrc/tests/memory_datasrc_unittest.cc | 39 ++++++++++++++++++++++
2 files changed, 56 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));
}
diff --git a/src/lib/datasrc/tests/memory_datasrc_unittest.cc b/src/lib/datasrc/tests/memory_datasrc_unittest.cc
index f54af75..07d1fb9 100644
--- a/src/lib/datasrc/tests/memory_datasrc_unittest.cc
+++ b/src/lib/datasrc/tests/memory_datasrc_unittest.cc
@@ -441,6 +441,8 @@ public:
{"0P9MHAVEQVM6T7VBL5LOP2U3T2RP3TOM.example.org. 300 IN "
"NSEC3 1 1 12 aabbccdd 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG",
&rr_nsec3_},
+ {"example.org. 300 IN NSEC cname.example.org. A NS NSEC",
+ &rr_nsec_},
{NULL, NULL}
};
@@ -505,6 +507,7 @@ public:
RRsetPtr rr_not_wild_;
RRsetPtr rr_not_wild_another_;
RRsetPtr rr_nsec3_;
+ RRsetPtr rr_nsec_;
// A faked NSEC3 hash calculator for convenience.
// Tests that need to use the faked hashed values should call
@@ -984,6 +987,9 @@ InMemoryZoneFinderTest::findCheck(ZoneFinder::FindResultFlags expected_flags) {
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec3_));
}
+ if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
+ EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec_));
+ }
// These two should be successful
findTest(origin_, RRType::NS(), ZoneFinder::SUCCESS, true, rr_ns_);
@@ -1011,6 +1017,10 @@ TEST_F(InMemoryZoneFinderTest, findNSEC3Signed) {
findCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
}
+TEST_F(InMemoryZoneFinderTest, findNSECSigned) {
+ findCheck(ZoneFinder::RESULT_NSEC_SIGNED);
+}
+
void
InMemoryZoneFinderTest::emptyNodeCheck(
ZoneFinder::FindResultFlags expected_flags)
@@ -1039,6 +1049,9 @@ InMemoryZoneFinderTest::emptyNodeCheck(
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec3_));
}
+ if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
+ EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec_));
+ }
// empty node matching, easy case: the node for 'baz' exists with
// no data.
@@ -1066,6 +1079,10 @@ TEST_F(InMemoryZoneFinderTest, emptyNodeNSEC3) {
emptyNodeCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
}
+TEST_F(InMemoryZoneFinderTest, emptyNodeNSEC) {
+ emptyNodeCheck(ZoneFinder::RESULT_NSEC_SIGNED);
+}
+
TEST_F(InMemoryZoneFinderTest, load) {
// Put some data inside the zone
EXPECT_NO_THROW(EXPECT_EQ(result::SUCCESS, zone_finder_.add(rr_ns_)));
@@ -1200,6 +1217,9 @@ InMemoryZoneFinderTest::wildcardCheck(
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec3_));
}
+ if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
+ EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec_));
+ }
// Search at the parent. The parent will not have the A, but it will
// be in the wildcard (so check the wildcard isn't matched at the parent)
@@ -1267,6 +1287,11 @@ TEST_F(InMemoryZoneFinderTest, wildcardNSEC3) {
wildcardCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
}
+TEST_F(InMemoryZoneFinderTest, wildcardNSEC) {
+ // Similar to the previous one, but the zone signed with NSEC
+ wildcardCheck(ZoneFinder::RESULT_NSEC_SIGNED);
+}
+
/*
* Test that we don't match a wildcard if we get under delegation.
* By 4.3.3 of RFC1034:
@@ -1301,6 +1326,9 @@ InMemoryZoneFinderTest::anyWildcardCheck(
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec3_));
}
+ if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
+ EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec_));
+ }
vector<ConstRRsetPtr> expected_sets;
@@ -1335,6 +1363,10 @@ TEST_F(InMemoryZoneFinderTest, anyWildcardNSEC3) {
anyWildcardCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
}
+TEST_F(InMemoryZoneFinderTest, anyWildcardNSEC) {
+ anyWildcardCheck(ZoneFinder::RESULT_NSEC_SIGNED);
+}
+
// Test there's nothing in the wildcard in the middle if we load
// wild.*.foo.example.org.
void
@@ -1351,6 +1383,9 @@ InMemoryZoneFinderTest::emptyWildcardCheck(
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec3_));
}
+ if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
+ EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nsec_));
+ }
{
SCOPED_TRACE("Asking for the original record under wildcard");
@@ -1395,6 +1430,10 @@ TEST_F(InMemoryZoneFinderTest, emptyWildcardNSEC3) {
emptyWildcardCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
}
+TEST_F(InMemoryZoneFinderTest, emptyWildcardNSEC) {
+ emptyWildcardCheck(ZoneFinder::RESULT_NSEC_SIGNED);
+}
+
// Same as emptyWildcard, but with multiple * in the path.
TEST_F(InMemoryZoneFinderTest, nestedEmptyWildcard) {
EXPECT_EQ(SUCCESS, zone_finder_.add(rr_nested_emptywild_));
More information about the bind10-changes
mailing list