From: Remi Gacogne Date: Fri, 29 Sep 2017 10:01:40 +0000 (+0200) Subject: rec: De-duplicate handling of TA/NTA state from getDSRecords() X-Git-Tag: rec-4.1.0-rc1~11^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18159e9239444f27abc69532c52a8cebb7f61d7e;p=thirdparty%2Fpdns.git rec: De-duplicate handling of TA/NTA state from getDSRecords() --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 70284b44d6..4f868471e8 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -1359,8 +1359,16 @@ vState SyncRes::getDSRecords(const DNSName& zone, dsmap_t& ds, bool taOnly, unsi *foundCut = (result != Indeterminate); } - if ((result == Secure || result == TA) && countSupportedDS(ds) == 0) { - ds.clear(); + if (result == TA) { + if (countSupportedDS(ds) == 0) { + ds.clear(); + result = Insecure; + } + else { + result = Secure; + } + } + else if (result == NTA) { result = Insecure; } @@ -1465,23 +1473,14 @@ bool SyncRes::lookForCut(const DNSName& qname, unsigned int depth, const vState newState = dsState; } - if (foundCut) { - if (newState == TA) { - newState = Secure; - } - else if (newState == NTA) { - newState = Insecure; - } - } - return foundCut; } void SyncRes::computeZoneCuts(const DNSName& begin, const DNSName& end, unsigned int depth) { if(!begin.isPartOf(end)) { - LOG(d_prefix<<" "<