From 161289b77898430a96c888080368ce5e9b87896c Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 20 Jun 2022 15:31:19 +0200 Subject: [PATCH] Move back to origial EDNSLevel logic. The handling around ednsMANDATORY is separate form the table handling, so do not mix these up. --- pdns/syncres.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 3745042add..8fc9b00343 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -1491,6 +1491,7 @@ LWResult::Result SyncRes::asyncresolveWrapper(const ComboAddress& ip, bool ednsM } } + int EDNSLevel = 0; auto luaconfsLocal = g_luaconfs.getLocal(); ResolveContext ctx; ctx.d_initialRequestId = d_initialRequestId; @@ -1503,12 +1504,12 @@ LWResult::Result SyncRes::asyncresolveWrapper(const ComboAddress& ip, bool ednsM for (int tries = 0; tries < 2; ++tries) { - int EDNSLevel = 1; - if (mode == EDNSStatus::NOEDNS && !ednsMANDATORY) { - EDNSLevel = 0; - } - if (EDNSLevel == 0) { + if (mode == EDNSStatus::NOEDNS) { g_stats.noEdnsOutQueries++; + EDNSLevel = 0; // level != mode + } + else if (ednsMANDATORY || mode != EDNSStatus::NOEDNS) { + EDNSLevel = 1; } DNSName sendQname(domain); -- 2.47.2