]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Do not use inverted logic for the pool's zero scope state
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 7 Oct 2025 09:26:02 +0000 (11:26 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 9 Oct 2025 12:01:25 +0000 (14:01 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/dnsdist-backend.cc
pdns/dnsdistdist/docs/reference/config.rst

index 9bd23b966e25f2fc0a6df32a6ee37d20dfe4efab..6217255294e1feef6d9afe0f2d90cffcea9993d0 100644 (file)
@@ -1112,21 +1112,20 @@ void ServerPool::updateConsistency()
       useECS = server->d_config.useECS;
       tcpOnly = server->isTCPOnly();
       zeroScope = !server->d_config.disableZeroScope;
+      continue;
     }
-    else {
-      if (consistent) {
-        if (server->d_config.useECS != useECS) {
-          consistent = false;
-        }
-        if (server->d_config.disableZeroScope == zeroScope) {
-          consistent = false;
-        }
+    if (consistent) {
+      if (server->d_config.useECS != useECS) {
+        consistent = false;
       }
-      if (server->isTCPOnly() != tcpOnly) {
+      if (server->d_config.disableZeroScope == zeroScope) {
         consistent = false;
-        tcpOnly = false;
       }
     }
+    if (server->isTCPOnly() != tcpOnly) {
+      consistent = false;
+      tcpOnly = false;
+    }
   }
 
   d_tcpOnly = tcpOnly;
index 9a7c042986b6c42ed2b487cca91e90246586940c..d4b96db7d3b3620150f6f2e7cba78f7dc16d0295 100644 (file)
@@ -987,11 +987,11 @@ Servers that are not assigned to a specific pool get assigned to the default poo
 
     Returns the :class:`PacketCache` for this pool or nil.
 
-  .. method:: ServerPool:getDisableZeroScope()
+  .. method:: ServerPool:getZeroScope()
 
     .. versionadded:: 2.0.1
 
-    Whether dnsdist will disable the EDNS Client Subnet :doc:`../advanced/zero-scope` feature when looking up into the cache,
+    Whether dnsdist will enable the EDNS Client Subnet :doc:`../advanced/zero-scope` feature when looking up into the cache,
     when all servers from this pool are down.
 
   .. method:: ServerPool:getECS()
@@ -1005,11 +1005,11 @@ Servers that are not assigned to a specific pool get assigned to the default poo
 
     :param PacketCache cache: The new cache to add to the pool
 
-  .. method:: ServerPool:setDisableZeroScope(disable)
+  .. method:: ServerPool:setZeroScope(enabled)
 
     .. versionadded:: 2.0.1
 
-    Set to true if dnsdist should disable the EDNS Client Subnet :doc:`../advanced/zero-scope` feature when looking up into the cache,
+    Set to false if dnsdist should disable the EDNS Client Subnet :doc:`../advanced/zero-scope` feature when looking up into the cache,
     when all servers from this pool are down.
 
   .. method:: ServerPool:setECS()