Parcourir la source

[1305] introduce WILDCARD_CNAME for ZoneFinder::Result, and use it for CNAME
on a wildcard.

JINMEI Tatuya il y a 13 ans
Parent
commit
32012c8148

+ 1 - 1
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;

+ 1 - 1
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();

+ 5 - 0
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
     };