]> granicus.if.org Git - pdns/commitdiff
Cache records for zones that were delegated to from a forwarded zone
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 30 Sep 2016 11:18:43 +0000 (13:18 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 30 Sep 2016 11:18:43 +0000 (13:18 +0200)
Fixes #4483

pdns/syncres.cc

index 44e0332495105a551e4fc94568ea30f50ad2973a..eb992c739e0fe7cc19ff39a34dbcd0413b27dec1 100644 (file)
@@ -1245,7 +1245,8 @@ int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, con
               // Check if we are authoritative for a zone in this answer
               DNSName tmp_qname(rec.d_name);
               auto auth_domain_iter=getBestAuthZone(&tmp_qname);
-              if(auth_domain_iter!=t_sstorage->domainmap->end()) {
+              if(auth_domain_iter!=t_sstorage->domainmap->end() &&
+                  auth.countLabels() <= auth_domain_iter->first.countLabels()) {
                 if (auth_domain_iter->first != auth) {
                   LOG("NO! - we are authoritative for the zone "<<auth_domain_iter->first<<endl);
                   continue;