From: Remi Gacogne Date: Wed, 2 Jun 2021 14:29:40 +0000 (+0200) Subject: rec: Cleaner way of handling a referral to a child zone for DS queries X-Git-Tag: auth-4.5.0-beta1~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10460%2Fhead;p=thirdparty%2Fpdns.git rec: Cleaner way of handling a referral to a child zone for DS queries --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 3aec916494..aabf85c2e9 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -3396,6 +3396,7 @@ bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, co bool done = false; DNSName dnameTarget, dnameOwner; uint32_t dnameTTL = 0; + bool referralOnDS = false; for (auto& rec : lwr.d_records) { if (rec.d_type != QType::OPT && rec.d_class != QClass::IN) { @@ -3591,21 +3592,20 @@ bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, co newauth = rec.d_name; LOG(prefix< '"<getZoneRepresentation()<<"'"<(rec)) { + nsset.insert(content->getNS()); + } } } else { LOG(prefix< '"<getZoneRepresentation()<<"', had '"<(rec)) { nsset.insert(content->getNS()); } @@ -3712,6 +3712,23 @@ bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, co cnamerec.d_content = std::make_shared(CNAMERecordContent(newtarget)); ret.push_back(std::move(cnamerec)); } + + /* If we have seen a proper denial, let's forget that we also had a referral for a DS query. + Otherwise we need to deal with it. */ + if (referralOnDS && !negindic) { + LOG(prefix<