]> granicus.if.org Git - pdns/commitdiff
Add code accidently removed in 0ad83dabffa6b0b44d298adfa3055b1eed7e0b03
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 13 Jul 2015 12:09:44 +0000 (14:09 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 15 Jul 2015 14:13:28 +0000 (16:13 +0200)
pdns/syncres.cc

index 0b0f994d7a1e2110aa7e76484d5bbd41392279b8..d51e4c73877cb1fd3a851506522391dfd70cb2cb 100644 (file)
@@ -1072,6 +1072,22 @@ int SyncRes::doResolveAt(set<DNSName> nameservers, DNSName auth, bool flawedNSSe
           continue;
         }
 
+        // Check if we are authoritative for a zone in this answer
+        if (!t_sstorage->domainmap->empty()) {
+          DNSName tmp_qname(i->qname);
+          auto auth_domain_iter=getBestAuthZone(&tmp_qname);
+          if(auth_domain_iter!=t_sstorage->domainmap->end()) {
+            if (auth_domain_iter->first != auth) {
+              LOG("NO! - we are authoritative for the zone "<<auth_domain_iter->first.toString()<<endl);
+              continue;
+            } else {
+              // ugly...
+              LOG("YES! - This answer was retrieved from the local auth store"<<endl);
+            }
+          }
+        }
+
+
         if(i->qname.isPartOf(auth)) {
           if(lwr.d_aabit && lwr.d_rcode==RCode::NoError && i->d_place==DNSResourceRecord::ANSWER && ::arg().contains("delegation-only",auth.toString() /* ugh */)) {
             LOG("NO! Is from delegation-only zone"<<endl);