From: JINMEI Tatuya Date: Sat, 15 Oct 2011 00:00:30 +0000 (-0700) Subject: [1305] introduce WILDCARD_CNAME for ZoneFinder::Result, and use it for CNAME X-Git-Tag: perftcpdns_before_epoll~79^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32012c8148dbf25fea0a490bd8453fcfb3854cbb;p=thirdparty%2Fkea.git [1305] introduce WILDCARD_CNAME for ZoneFinder::Result, and use it for CNAME on a wildcard. --- diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc index e476297885..54e559020b 100644 --- a/src/lib/datasrc/database.cc +++ b/src/lib/datasrc/database.cc @@ -553,7 +553,7 @@ DatabaseClient::Finder::find(const isc::dns::Name& name, if (cni != found.second.end() && type != RRType::CNAME()) { result_rrset = cni->second; - result_status = CNAME; + result_status = WILDCARD_CNAME; } else if (nsi != found.second.end()) { result_rrset = nsi->second; result_status = DELEGATION; diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc index 8cd70eff56..0ae8c256b5 100644 --- a/src/lib/datasrc/tests/database_unittest.cc +++ b/src/lib/datasrc/tests/database_unittest.cc @@ -1626,7 +1626,7 @@ TYPED_TEST(DatabaseClientTest, wildcard) { this->expected_sig_rdatas_.clear(); doFindTest(*finder, isc::dns::Name("a.cnamewild.example.org."), isc::dns::RRType::TXT(), isc::dns::RRType::CNAME(), - this->rrttl_, ZoneFinder::CNAME, + this->rrttl_, ZoneFinder::WILDCARD_CNAME, this->expected_rdatas_, this->expected_sig_rdatas_); this->expected_rdatas_.clear(); diff --git a/src/lib/datasrc/zone.h b/src/lib/datasrc/zone.h index c83b14b779..640a55ace4 100644 --- a/src/lib/datasrc/zone.h +++ b/src/lib/datasrc/zone.h @@ -63,6 +63,10 @@ public: /// actually the best wildcard we have). Data sources that don't /// support DNSSEC don't need to distinguish them. /// + /// In case of CNAME, if the CNAME is a wildcard (i.e., its owner name + /// starts with the label "*"), WILDCARD_CNAME will be returned instead + /// of CNAME. + /// /// In case of NXRRSET related results, the returned NSEC record /// belongs to the domain which would provide the result if it /// contained the correct type (in case of NXRRSET, it is the queried @@ -97,6 +101,7 @@ public: CNAME, ///< The search encounters and returns a CNAME RR DNAME, ///< The search encounters and returns a DNAME RR WILDCARD, ///< Succes by wildcard match, for DNSSEC + WILDCARD_CNAME, ///< CNAME on wildcard, search returns CNAME, for DNSSEC WILDCARD_NXRRSET ///< NXRRSET on wildcard, for DNSSEC };