From: Peter van Dijk Date: Thu, 9 Feb 2012 09:04:55 +0000 (+0000) Subject: fix very rare condition in which recursor would lose root hints X-Git-Tag: auth-3.1-rc1~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97df07f87fd3f28fdc4deed0be776eef8d6f74f2;p=pdns fix very rare condition in which recursor would lose root hints git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2380 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 871002480..5cd5416a9 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -426,20 +426,11 @@ int SyncRes::doResolve(const string &qname, const QType &qtype, vector nsset; bool flawedNSSet=false; + + // the two retries allow getBestNSNamesFromCache&co to reprime the root + // hints, in case they ever go missing for(int tries=0;tries<2 && nsset.empty();++tries) { subdomain=getBestNSNamesFromCache(subdomain, nsset, &flawedNSSet, depth, beenthere); // pass beenthere to both occasions - - if(nsset.empty()) { // must've lost root records - set rootset; - /* this additional test is needed since getBestNSNamesFromCache sometimes returns that no - useful NS records were found, even without the root being expired. This might for example - be the case when the . records are not acceptable because they are part of a loop, a loop - caused by the invalidation of an nsset during the resolution algorithm */ - if(t_RC->get(d_now.tv_sec, ".", QType(QType::NS), &rootset) <= 0) { - L<&bes } } LOG<