From: Otto Moerbeek Date: Mon, 20 Jun 2022 13:31:19 +0000 (+0200) Subject: Move back to origial EDNSLevel logic. X-Git-Tag: auth-4.8.0-alpha0~53^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11704%2Fhead;p=thirdparty%2Fpdns.git Move back to origial EDNSLevel logic. The handling around ednsMANDATORY is separate form the table handling, so do not mix these up. --- 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);