From 18159e9239444f27abc69532c52a8cebb7f61d7e Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 29 Sep 2017 12:01:40 +0200 Subject: [PATCH] rec: De-duplicate handling of TA/NTA state from getDSRecords() --- pdns/syncres.cc | 43 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) 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<<" "<