From: Kees Monshouwer Date: Wed, 22 Jan 2014 11:46:38 +0000 (+0100) Subject: axfr in, update metadata before records insert X-Git-Tag: rec-3.6.0-rc1~229^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f2aa4977a37e551362fc8e34745c4d56d12e55f;p=pdns axfr in, update metadata before records insert --- diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index 14f0cad44..6a6725ad7 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -239,6 +239,36 @@ void CommunicatorClass::suck(const string &domain,const string &remote) L<startTransaction(domain, domain_id); + // update the presigned flag and NSEC3PARAM + if (gotPresigned) { + if (!hadDnssecZone && !hadPresigned) { + // zone is now presigned + dk.setPresigned(domain); + } + + if (hadPresigned || !hadDnssecZone) + { + // this is a presigned zone, update NSEC3PARAM + if (gotNSEC3) { + ns3pr.d_flags = gotOptOutFlag ? 1 : 0; + // only update if there was a change + if (!hadNSEC3 || (narrow != hadNarrow) || + (ns3pr.d_algorithm != hadNs3pr.d_algorithm) || + (ns3pr.d_flags != hadNs3pr.d_flags) || + (ns3pr.d_iterations != hadNs3pr.d_iterations) || + (ns3pr.d_salt != hadNs3pr.d_salt)) { + dk.setNSEC3PARAM(domain, ns3pr, narrow); + } + } else if (hadNSEC3) { + dk.unsetNSEC3PARAM(domain); + } + } + } else if (hadPresigned) { + // zone is no longer presigned + dk.unsetPresigned(domain); + dk.unsetNSEC3PARAM(domain); + } + bool doent=true; uint32_t maxent = ::arg().asNum("max-ent-entries"); string ordername, shorter; @@ -306,37 +336,6 @@ void CommunicatorClass::suck(const string &domain,const string &remote) di.backend->feedEnts(domain_id, nonterm); } - // now we also need to update the presigned flag and NSEC3PARAM - // for the zone - if (gotPresigned) { - if (!hadDnssecZone && !hadPresigned) { - // zone is now presigned - dk.setPresigned(domain); - } - - if (hadPresigned || !hadDnssecZone) - { - // this is a presigned zone, update NSEC3PARAM - if (gotNSEC3) { - ns3pr.d_flags = gotOptOutFlag ? 1 : 0; - // only update if there was a change - if (!hadNSEC3 || (narrow != hadNarrow) || - (ns3pr.d_algorithm != hadNs3pr.d_algorithm) || - (ns3pr.d_flags != hadNs3pr.d_flags) || - (ns3pr.d_iterations != hadNs3pr.d_iterations) || - (ns3pr.d_salt != hadNs3pr.d_salt)) { - dk.setNSEC3PARAM(domain, ns3pr, narrow); - } - } else if (hadNSEC3) { - dk.unsetNSEC3PARAM(domain); - } - } - } else if (hadPresigned) { - // zone is no longer presigned - dk.unsetPresigned(domain); - dk.unsetNSEC3PARAM(domain); - } - di.backend->commitTransaction(); di.backend->setFresh(domain_id); PC.purge(domain+"$");