From: Kees Monshouwer Date: Tue, 27 Oct 2020 19:59:15 +0000 (+0100) Subject: auth: partial revert of #9470 X-Git-Tag: auth-4.4.0-alpha2~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9649%2Fhead;p=thirdparty%2Fpdns.git auth: partial revert of #9470 --- diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index 7e5702cc0a..e4f77a0a95 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -907,14 +907,13 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P) // Do not overwrite received DI just to make sure it exists in backend: // di.masters should contain the picked master (as first entry)! DomainInfo tempdi; - if (!B->getDomainInfo(di.zone, tempdi)) { + if (!B->getDomainInfo(di.zone, tempdi, false)) { g_log<lookup(QType(QType::SOA), di.zone, di.id, nullptr); + DNSZoneRecord zr; + hasSOA = B->get(zr); + if (hasSOA) { + fillSOAData(zr, sd); + while(B->get(zr)); + } + } + catch(...) {} + uint32_t theirserial = ssr.d_freshness[di.id].theirSerial; - uint32_t ourserial = di.serial; + uint32_t ourserial = sd.serial; const ComboAddress remote = *di.masters.begin(); - if(rfc1982LessThan(theirserial, ourserial) && ourserial != 0 && !::arg().mustDo("axfr-lower-serial")) { + if(hasSOA && rfc1982LessThan(theirserial, ourserial) && !::arg().mustDo("axfr-lower-serial")) { g_log< their serial "<< theirserial << endl; di.backend->setFresh(di.id); } - else if(ourserial != 0 && theirserial == ourserial) { + else if(hasSOA && theirserial == ourserial) { uint32_t maxExpire=0, maxInception=0; if(dk.isPresigned(di.zone)) { B->lookup(QType(QType::RRSIG), di.zone, di.id); // can't use DK before we are done with this lookup! @@ -989,11 +1002,12 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P) } } else { - if (ourserial == 0) { - g_log<