]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move back to origial EDNSLevel logic. 11704/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 20 Jun 2022 13:31:19 +0000 (15:31 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 20 Jun 2022 13:31:19 +0000 (15:31 +0200)
The handling around ednsMANDATORY is separate form the table handling,
so do not mix these up.

pdns/syncres.cc

index 3745042addfbaf5376131c555001e2d908be724c..8fc9b00343fd5a8dabf9fd73925d507e25101de1 100644 (file)
@@ -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);