BIND 10 master, updated. 8909387beb99136bc5ec22574515c84e8ef526da Merge branch 'master' of git+ssh://bind10.isc.org/var/bind10/git/bind10
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jan 28 08:14:21 UTC 2011
The branch, master has been updated
via 8909387beb99136bc5ec22574515c84e8ef526da (commit)
via 952124e0f4d2b64d8b3a47b52163edca7c3546ab (commit)
via af4b23610ff5cb55748737dff2b67c4f905b2480 (commit)
via 661ee8d341d0a24b6cab13302b028a9efb40daa4 (commit)
via 1dd7c3d6806b8694fa315f55c105884245e486ea (commit)
via 94b0beeb606dedc3c8fc44856e0a6f2d3c9754b4 (commit)
via 424bb3df5cd1e1cf8b64f76ff5f0118da05de9e6 (commit)
from 73a679d7b03fc3c53fb4826a95ee099321fb4c4d (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 8909387beb99136bc5ec22574515c84e8ef526da
Merge: 952124e0f4d2b64d8b3a47b52163edca7c3546ab 73a679d7b03fc3c53fb4826a95ee099321fb4c4d
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Jan 28 09:10:13 2011 +0100
Merge branch 'master' of git+ssh://bind10.isc.org/var/bind10/git/bind10
commit 952124e0f4d2b64d8b3a47b52163edca7c3546ab
Merge: c5d416a01e152b936c0023fcc65d3d468250388b af4b23610ff5cb55748737dff2b67c4f905b2480
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Jan 28 08:57:51 2011 +0100
Merge remote-tracking branch 'origin/trac526'
Conflicts:
src/bin/auth/query.cc
commit af4b23610ff5cb55748737dff2b67c4f905b2480
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Thu Jan 27 10:34:05 2011 -0800
[trac526] added tests for explicit type CNAME queries. added notes about
points to be considered with chaining.
commit 661ee8d341d0a24b6cab13302b028a9efb40daa4
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Jan 27 11:09:49 2011 +0100
[trac526] More CNAME tests
They are almost the same right now, but they will be different once the
CNAME chaining is implemented.
commit 1dd7c3d6806b8694fa315f55c105884245e486ea
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Jan 27 10:47:10 2011 +0100
[trac526] Cosmetic comment fix
commit 94b0beeb606dedc3c8fc44856e0a6f2d3c9754b4
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Jan 26 13:43:28 2011 +0100
[trac526] Implement returning CNAME
No chaining is implemented. While RFC 1024 indicates we should do it at
last inside the same zone, we don't now and leave it out for later.
The CNAME is handled in the same way as as SUCCESS with slight
modification about additional data (which probably never happen in real
life anyway).
commit 424bb3df5cd1e1cf8b64f76ff5f0118da05de9e6
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Jan 26 13:16:13 2011 +0100
[trac526] Test for CNAME
No chaining yet.
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/query.cc | 11 +++-
src/bin/auth/tests/query_unittest.cc | 108 +++++++++++++++++++++++++++++++++-
2 files changed, 116 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc
index e270500..e85c31a 100644
--- a/src/bin/auth/query.cc
+++ b/src/bin/auth/query.cc
@@ -148,6 +148,15 @@ Query::process() const {
result.zone->find(qname_, qtype_, target.get());
switch (db_result.code) {
+ case Zone::CNAME:
+ /*
+ * We don't do chaining yet. Therefore handling a CNAME is
+ * mostly the same as handling SUCCESS, but we didn't get
+ * what we expected. It means no exceptions in ANY or NS
+ * on the origin (though CNAME in origin is probably
+ * forbidden anyway).
+ */
+ // No break; here, fall trough.
case Zone::SUCCESS:
response_.setRcode(Rcode::NOERROR());
if (qtype_is_any) {
@@ -167,6 +176,7 @@ Query::process() const {
// and AAAA/A RRS of each of the NS RDATA into the additional
// section.
if (qname_ != result.zone->getOrigin() ||
+ db_result.code != Zone::SUCCESS ||
(qtype_ != RRType::NS() && !qtype_is_any))
{
getAuthAdditional(*result.zone);
@@ -189,7 +199,6 @@ Query::process() const {
response_.setRcode(Rcode::NOERROR());
putSOA(*result.zone);
break;
- case Zone::CNAME:
case Zone::DNAME:
// TODO : replace qname, continue lookup
break;
diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc
index 6ea0ac3..3bf4142 100644
--- a/src/bin/auth/tests/query_unittest.cc
+++ b/src/bin/auth/tests/query_unittest.cc
@@ -68,9 +68,15 @@ const char* const mx_txt =
"mx.example.com. 3600 IN MX 20 mailer.example.org.\n"
"mx.example.com. 3600 IN MX 30 mx.delegation.example.com.\n";
const char* const www_a_txt = "www.example.com. 3600 IN A 192.0.2.80\n";
+const char* const cname_txt =
+ "cname.example.com. 3600 IN CNAME www.example.com.\n";
+const char* const cname_nxdom_txt =
+ "cnamenxdom.example.com. 3600 IN CNAME nxdomain.example.com.\n";
+// CNAME Leading out of zone
+const char* const cname_out_txt =
+ "cnameout.example.com. 3600 IN CNAME www.example.org.\n";
// The rest of data won't be referenced from the test cases.
const char* const other_zone_rrs =
- "cname.example.com. 3600 IN CNAME www.example.com.\n"
"cnamemailer.example.com. 3600 IN CNAME www.example.com.\n"
"cnamemx.example.com. 3600 IN MX 10 cnamemailer.example.com.\n"
"mx.delegation.example.com. 3600 IN A 192.0.2.100\n";
@@ -95,7 +101,8 @@ public:
{
stringstream zone_stream;
zone_stream << soa_txt << zone_ns_txt << ns_addrs_txt <<
- delegation_txt << mx_txt << www_a_txt << other_zone_rrs;
+ delegation_txt << mx_txt << www_a_txt << cname_txt <<
+ cname_nxdom_txt << cname_out_txt << other_zone_rrs;
masterLoad(zone_stream, origin_, rrclass_,
boost::bind(&MockZone::loadRRset, this, _1));
@@ -422,4 +429,101 @@ TEST_F(QueryTest, MXAlias) {
responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
NULL, NULL, ns_addrs_txt);
}
+
+/*
+ * Tests encountering a cname.
+ *
+ * There are tests leading to successful answers, NXRRSET, NXDOMAIN and
+ * out of the zone.
+ *
+ * TODO: We currently don't do chaining, so only the CNAME itself should be
+ * returned.
+ */
+TEST_F(QueryTest, CNAME) {
+ Query(memory_datasrc, Name("cname.example.com"), RRType::A(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, explicitCNAME) {
+ // same owner name as the CNAME test but explicitly query for CNAME RR.
+ // expect the same response as we don't provide a full chain yet.
+ Query(memory_datasrc, Name("cname.example.com"), RRType::CNAME(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, CNAME_NX_RRSET) {
+ // Leads to www.example.com, it doesn't have TXT
+ // note: with chaining, what should be expected is not trivial:
+ // BIND 9 returns the CNAME in answer and SOA in authority, no additional.
+ // NSD returns the CNAME, NS in authority, A/AAAA for NS in additional.
+ Query(memory_datasrc, Name("cname.example.com"), RRType::TXT(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, explicitCNAME_NX_RRSET) {
+ // same owner name as the NXRRSET test but explicitly query for CNAME RR.
+ Query(memory_datasrc, Name("cname.example.com"), RRType::CNAME(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, CNAME_NX_DOMAIN) {
+ // Leads to nxdomain.example.com
+ // note: with chaining, what should be expected is not trivial:
+ // BIND 9 returns the CNAME in answer and SOA in authority, no additional,
+ // RCODE being NXDOMAIN.
+ // NSD returns the CNAME, NS in authority, A/AAAA for NS in additional,
+ // RCODE being NOERROR.
+ Query(memory_datasrc, Name("cnamenxdom.example.com"), RRType::A(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_nxdom_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, explicitCNAME_NX_DOMAIN) {
+ // same owner name as the NXDOMAIN test but explicitly query for CNAME RR.
+ Query(memory_datasrc, Name("cnamenxdom.example.com"), RRType::CNAME(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_nxdom_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, CNAME_OUT) {
+ /*
+ * This leads out of zone. This should have only the CNAME even
+ * when we do chaining.
+ *
+ * TODO: We should be able to have two zones in the mock data source.
+ * Then the same test should be done with .org included there and
+ * see what it does (depends on what we want to do)
+ */
+ Query(memory_datasrc, Name("cnameout.example.com"), RRType::A(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_out_txt, zone_ns_txt, ns_addrs_txt);
+}
+
+TEST_F(QueryTest, explicitCNAME_OUT) {
+ // same owner name as the OUT test but explicitly query for CNAME RR.
+ Query(memory_datasrc, Name("cnameout.example.com"), RRType::CNAME(),
+ response).process();
+
+ responseCheck(response, Rcode::NOERROR(), AA_FLAG, 1, 3, 3,
+ cname_out_txt, zone_ns_txt, ns_addrs_txt);
+}
+
}
More information about the bind10-changes
mailing list