From: Kees Monshouwer Date: Fri, 30 Nov 2018 07:14:42 +0000 (+0100) Subject: auth: load serial in slaveRefresh() X-Git-Tag: auth-4.2.0-alpha1~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b76c5f3a69659c3d93282d2d3cb6de4a238c5b29;p=thirdparty%2Fpdns.git auth: load serial in slaveRefresh() --- diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index 27d6e05427..138441a9cb 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -923,13 +923,20 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P) d_failedSlaveRefresh.erase(di.zone); } - uint32_t theirserial = ssr.d_freshness[di.id].theirSerial, ourserial = di.serial; + bool hasSOA = false; + SOAData sd; + try{ + hasSOA = B->getSOA(di.zone, sd); + } + catch(...) {} + + uint32_t theirserial = ssr.d_freshness[di.id].theirSerial, ourserial = sd.serial; if(rfc1982LessThan(theirserial, ourserial) && ourserial != 0 && !::arg().mustDo("axfr-lower-serial")) { g_log< their serial "<< theirserial << endl; di.backend->setFresh(di.id); } - else if(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); // can't use DK before we are done with this lookup! @@ -968,7 +975,12 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P) } } else { - g_log<