BIND 10 trac1310, updated. fda23d6cf412c2a90df325c244f79811d939d3c7 [1310] Add branch wildcard_nxrrset in query_unittest.cc
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Nov 16 07:09:31 UTC 2011
The branch, trac1310 has been updated
via fda23d6cf412c2a90df325c244f79811d939d3c7 (commit)
via 32b1e0701a9b138321e510a432c5cdd49fa336c6 (commit)
from 936e61c743af685c398abc7590cd813b70a5f5e5 (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 fda23d6cf412c2a90df325c244f79811d939d3c7
Author: xiejiagui <xiejiagui at zenus.(none)>
Date: Wed Nov 16 14:28:05 2011 +0800
[1310] Add branch wildcard_nxrrset in query_unittest.cc
commit 32b1e0701a9b138321e510a432c5cdd49fa336c6
Author: xiejiagui <xiejiagui at zenus.(none)>
Date: Wed Nov 16 11:53:17 2011 +0800
[1310] Add WILDCARD_NXRRSET case in Query.process()
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/query.cc | 9 +++++++++
src/bin/auth/tests/query_unittest.cc | 27 +++++++++++++++++++++++++--
2 files changed, 34 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc
index b2e0234..6f324f2 100644
--- a/src/bin/auth/query.cc
+++ b/src/bin/auth/query.cc
@@ -355,6 +355,15 @@ Query::process() {
dnssec_);
}
break;
+ case ZoneFinder::WILDCARD_NXRRSET:
+ addSOA(*result.zone_finder);
+ if(dnssec_ && db_result.rrset) {
+ response_.addRRset(Message::SECTION_AUTHORITY,
+ boost::const_pointer_cast<RRset>(
+ db_result.rrset),
+ dnssec_);
+ }
+ break;
default:
// This is basically a bug of the data source implementation,
// but could also happen in the middle of development where
diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc
index 16a2409..42741f4 100644
--- a/src/bin/auth/tests/query_unittest.cc
+++ b/src/bin/auth/tests/query_unittest.cc
@@ -402,9 +402,17 @@ MockZoneFinder::find(const Name& name, const RRType& type,
domain = domains_.find(Name("*").concatenate(wild_suffix));
assert(domain != domains_.end());
RRsetStore::const_iterator found_rrset = domain->second.find(type);
- assert(found_rrset != domain->second.end());
- return (FindResult(WILDCARD,
+ if (found_rrset != domain->second.end()) {
+ return (FindResult(WILDCARD,
substituteWild(*found_rrset->second, name)));
+ } else {
+ found_rrset = domain->second.find(RRType::NSEC());
+ assert(found_rrset != domain->second.end());
+ Name newName = Name("*").concatenate(wild_suffix);
+ return (FindResult(WILDCARD_NXRRSET,
+ substituteWild(*found_rrset->second,newName)));
+ }
+
}
const Name cnamewild_suffix("cnamewild.example.com");
if (name.compare(cnamewild_suffix).getRelation() ==
@@ -924,6 +932,21 @@ TEST_F(QueryTest, badWildcardProof3) {
Query::BadNSEC);
}
+TEST_F(QueryTest, wildcardNxrrsetWithNSEC1) {
+ // NXRRSET with DNSSEC proof. We should have SOA, NSEC that proves the
+ // NXRRSET and their RRSIGs.
+ Query(memory_client, Name("www.wild.example.com"), RRType::TXT(), response,
+ true).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 0, 4, 0, NULL,
+ (string(soa_txt) + string("example.com. 3600 IN RRSIG ") +
+ getCommonRRSIGText("SOA") + "\n" +
+ string(nsec_wild_txt) +
+ string("*.wild.example.com. 3600 IN RRSIG ") +
+ getCommonRRSIGText("NSEC")+"\n").c_str(),
+ NULL, mock_finder->getOrigin());
+}
+
/*
* This tests that when there's no SOA and we need a negative answer. It should
* throw in that case.
More information about the bind10-changes
mailing list