From: Robin Geuze Date: Sat, 14 Mar 2020 11:24:35 +0000 (+0100) Subject: Also only add CDS and CDNSKEY to the type map in case we have published DNSKEY's X-Git-Tag: dnsdist-1.5.0-alpha1~14^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caa1f48db28a46abd1ce7ac2aa3b4b3cda4e38f0;p=thirdparty%2Fpdns.git Also only add CDS and CDNSKEY to the type map in case we have published DNSKEY's --- diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index b37ca9d83c..6defb6f1f2 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -509,15 +509,15 @@ void PacketHandler::emitNSEC(std::unique_ptr& r, const SOAData& sd, c auto keyset = d_dk.getKeys(name); if (!keyset.empty()) { nrc.set(QType::DNSKEY); + string publishCDNSKEY; + d_dk.getPublishCDNSKEY(name, publishCDNSKEY); + if (publishCDNSKEY == "1") + nrc.set(QType::CDNSKEY); + string publishCDS; + d_dk.getPublishCDS(name, publishCDS); + if (! publishCDS.empty()) + nrc.set(QType::CDS); } - string publishCDNSKEY; - d_dk.getPublishCDNSKEY(name, publishCDNSKEY); - if (publishCDNSKEY == "1") - nrc.set(QType::CDNSKEY); - string publishCDS; - d_dk.getPublishCDS(name, publishCDS); - if (! publishCDS.empty()) - nrc.set(QType::CDS); } DNSZoneRecord rr; @@ -561,15 +561,15 @@ void PacketHandler::emitNSEC3(std::unique_ptr& r, const SOAData& sd, auto keyset = d_dk.getKeys(name); if (!keyset.empty()) { n3rc.set(QType::DNSKEY); + string publishCDNSKEY; + d_dk.getPublishCDNSKEY(name, publishCDNSKEY); + if (publishCDNSKEY == "1") + n3rc.set(QType::CDNSKEY); + string publishCDS; + d_dk.getPublishCDS(name, publishCDS); + if (! publishCDS.empty()) + n3rc.set(QType::CDS); } - string publishCDNSKEY; - d_dk.getPublishCDNSKEY(name, publishCDNSKEY); - if (publishCDNSKEY == "1") - n3rc.set(QType::CDNSKEY); - string publishCDS; - d_dk.getPublishCDS(name, publishCDS); - if (! publishCDS.empty()) - n3rc.set(QType::CDS); } B.lookup(QType(QType::ANY), name, sd.domain_id);