Permalink
Browse files

this fixes an accidental commit, but leaves some parts in place. Spec…

…ifically, our 'beenthere' checks

were accidentally refusing to re-ask anything if *either* ipv4 or ipv6 had asked them already. This is now
sorta fixed.
  • Loading branch information...
1 parent c363d53 commit 76f190f2a0877cd79ede2994124c1a58dc69ae49 @ahupowerdns ahupowerdns committed Dec 22, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −6 pdns/syncres.cc
View
@@ -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);

0 comments on commit 76f190f

Please sign in to comment.