From: Otto Moerbeek Date: Tue, 15 Mar 2022 14:31:13 +0000 (+0100) Subject: The nsset can change, so we have to be prepared for that X-Git-Tag: rec-4.7.0-beta1~44^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dad41bb83c1a58ab4327c8f96407055959f15ab4;p=thirdparty%2Fpdns.git The nsset can change, so we have to be prepared for that --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index b60f78d0de..763ef7cc7b 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -3481,8 +3481,8 @@ void SyncRes::rememberParentSetIfNeeded(const DNSName& domain, const vector(ns); authSet.insert(content->getNS()); } - // The glue IPs could also differ, but we're not checking that yet, we're only looking for child NS records not - // in the parent set + // The glue IPs could also differ, but we're not checking that yet, we're only looking for parent NS records not + // in the child set bool shouldSave = false; for (const auto& ns : existing) { auto content = getRR(ns); @@ -4739,12 +4739,13 @@ int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, con } } else { - if (fallBack == nullptr) { - /* if tns is empty, retrieveAddressesForNS() knows we have hardcoded servers (i.e. "forwards") */ + if (fallBack != nullptr) { + if (auto it = fallBack->find(tns->first); it != fallBack->end()) { + remoteIPs = it->second; + } + } + if (remoteIPs.size() == 0) { remoteIPs = retrieveAddressesForNS(prefix, qname, tns, depth, beenthere, rnameservers, nameservers, sendRDQuery, pierceDontQuery, flawedNSSet, cacheOnly, addressQueriesForNS); - } else { - // should be safe, caller makes sure nameservers and fallback contain the same names - remoteIPs = fallBack->at(tns->first); } if(remoteIPs.empty()) {