]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
this fixes an accidental commit, but leaves some parts in place. Specifically, our...
authorbert hubert <bert.hubert@netherlabs.nl>
Mon, 22 Dec 2014 08:12:28 +0000 (09:12 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Mon, 22 Dec 2014 08:12:28 +0000 (09:12 +0100)
were accidentally refusing to re-ask anything if *either* ipv4 or ipv6 had asked them already. This is now
sorta fixed.

pdns/syncres.cc

index 1aaa2d3979ca81ac4f17598d4d10b95546e5e403..dab3a5bb99f474b376755100e221cc4526cc6ac0 100644 (file)
@@ -487,7 +487,7 @@ vector<ComboAddress> SyncRes::getAddrs(const string &qname, int depth, set<GetBe
         break;
     }
 
-    if(!doResolve(qname, type, res,depth+1, rbeenthere) && !res.empty()) {  // this consults cache, OR goes out
+    if(!doResolve(qname, type, res,depth+1, j==1 ? beenthere : rbeenthere) && !res.empty()) {  // this consults cache, OR goes out
       for(res_t::const_iterator i=res.begin(); i!= res.end(); ++i) {
         if(i->qtype.getCode()==QType::A || i->qtype.getCode()==QType::AAAA) {
           ret.push_back(ComboAddress(i->content, 53));
@@ -497,7 +497,7 @@ vector<ComboAddress> SyncRes::getAddrs(const string &qname, int depth, set<GetBe
     }
     if(done) break;
   }
-
+  
   if(ret.size() > 1) {
     random_shuffle(ret.begin(), ret.end(), dns_random);
 
@@ -576,7 +576,7 @@ void SyncRes::getBestNSFromCache(const string &qname, set<DNSResourceRecord>&bes
       }
     }
     LOG(prefix<<qname<<": no valid/useful NS in cache for '"<<subdomain<<"'"<<endl);
-    // if(subdomain==".") { primeHints(); }
+    if(subdomain==".") { primeHints(); }
   }while(chopOffDotted(subdomain));
 }
 
@@ -882,7 +882,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
           pierceDontQuery=true;
         }
         else {
-          remoteIPs=getAddrs(*tns, depth+1, beenthere);
+          remoteIPs=getAddrs(*tns, depth+2, beenthere);
           pierceDontQuery=false;
         }
 
@@ -905,7 +905,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
         }
 
         for(remoteIP = remoteIPs.begin(); remoteIP != remoteIPs.end(); ++remoteIP) {
-          LOG(prefix<<qname<<": Trying IP "<< remoteIP->toStringWithPort() <<" "<<depth<<", asking '"<<qname<<"|"<<qtype.getName()<<"'"<<endl);
+          LOG(prefix<<qname<<": Trying IP "<< remoteIP->toStringWithPort() <<", asking '"<<qname<<"|"<<qtype.getName()<<"'"<<endl);
           extern NetmaskGroup* g_dontQuery;
           
           if(t_sstorage->throttle.shouldThrottle(d_now.tv_sec, boost::make_tuple(*remoteIP, "", 0))) {
@@ -965,7 +965,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
               continue;
             }
 
-           if(d_timeouts + 0.5*d_throttledqueries > 6.0 && d_timeouts > 2) throw ImmediateServFailException("Too much work resolving "+qname+"|"+qtype.getName()+", timeouts: "+boost::lexical_cast<string>(d_timeouts) +", throttles: "+boost::lexical_cast<string>(d_throttledqueries));
+//         if(d_timeouts + 0.5*d_throttledqueries > 6.0 && d_timeouts > 2) throw ImmediateServFailException("Too much work resolving "+qname+"|"+qtype.getName()+", timeouts: "+boost::lexical_cast<string>(d_timeouts) +", throttles: "+boost::lexical_cast<string>(d_throttledqueries));
 
             if(lwr.d_rcode==RCode::ServFail || lwr.d_rcode==RCode::Refused) {
               LOG(prefix<<qname<<": "<<*tns<<" returned a "<< (lwr.d_rcode==RCode::ServFail ? "ServFail" : "Refused") << ", trying sibling IP or NS"<<endl);