Browse Source

ANY queries should set the REFERRAL flag too.

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1327 e5f2f494-b856-4b98-b285-d166d9295462
Evan Hunt 15 years ago
parent
commit
d87914964c
2 changed files with 7 additions and 4 deletions
  1. 2 2
      src/lib/auth/sqlite3_datasrc.cc
  2. 5 2
      src/lib/auth/tests/sqlite3_unittest.cc

+ 2 - 2
src/lib/auth/sqlite3_datasrc.cc

@@ -123,9 +123,9 @@ importSqlite3Rows(sqlite3_stmt* query, const Name& qname, const RRClass& qclass,
         // found an NS; we need to inform the caller that this might be a
         // referral, but we do not return the NS RRset to the caller
         // unless asked for it.
-        if (base_rrtype == RRType::NS() && !qtype_is_any) {
+        if (base_rrtype == RRType::NS()) {
             flags |= DataSrc::REFERRAL;
-            if (qtype != RRType::NS()) {
+            if (!qtype_is_any && qtype != RRType::NS()) {
                 rc = sqlite3_step(query);
                 continue;
             }

+ 5 - 2
src/lib/auth/tests/sqlite3_unittest.cc

@@ -481,11 +481,14 @@ TEST_F(Sqlite3DataSourceTest, findRRsetApexANY) {
     signatures.push_back(&apex_dnskey_sig_data);
 
     rrtype = RRType::ANY();
+
+    // there is an NS at the zone apex, so the REFERRAL flag should
+    // be set, but will ordinarily be ignored by the caller
     checkFind(NORMAL, data_source, zone_name, NULL, rrclass, rrtype,
-              ttls, 0, types, answers, signatures);
+              ttls, DataSrc::REFERRAL, types, answers, signatures);
 
     checkFind(NORMAL, data_source, zone_name, &zone_name, rrclass,
-              rrtype, ttls, 0, types, answers, signatures);
+              rrtype, ttls, DataSrc::REFERRAL, types, answers, signatures);
 }
 
 TEST_F(Sqlite3DataSourceTest, findRRsetMixedANY) {