From: Otto Moerbeek Date: Wed, 6 Nov 2019 10:15:30 +0000 (+0100) Subject: Avoid mthread race when using the set of rootNSZones. X-Git-Tag: dnsdist-1.4.0~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8510%2Fhead;p=thirdparty%2Fpdns.git Avoid mthread race when using the set of rootNSZones. --- diff --git a/pdns/reczones.cc b/pdns/reczones.cc index c811b0c989..cade82750a 100644 --- a/pdns/reczones.cc +++ b/pdns/reczones.cc @@ -127,7 +127,11 @@ void primeRootNSZones(bool dnssecmode) sr.setDoDNSSEC(true); sr.setDNSSECValidationRequested(true); } - for (const auto & qname: t_rootNSZones) { + + // beginResolve() can yield to another mthread that could trigger t_rootNSZones updates, + // so make a local copy + set copy(t_rootNSZones); + for (const auto & qname: copy) { t_RC->doWipeCache(qname, false, QType::NS); vector ret; sr.beginResolve(qname, QType(QType::NS), QClass::IN, ret);