]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #13930 from omoerbeek/sdig-no-xpf
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 18 Mar 2024 11:41:54 +0000 (12:41 +0100)
committerGitHub <noreply@github.com>
Mon, 18 Mar 2024 11:41:54 +0000 (12:41 +0100)
sdig: remove xpf handling

.github/workflows/build-packages.yml
.github/workflows/builder-dispatch.yml
pdns/dnsdistdist/dnsdist-idstate.hh
pdns/recursordist/pdns_recursor.cc
regression-tests.recursor-dnssec/test_TraceFail.py [new file with mode: 0644]
regression-tests.recursor-dnssec/test_ZTC.py

index 13ab3a36b379b89025ad4316b56728cf815114fc..0d1123980f21a4424b68b4f0eae5c805426d924b 100644 (file)
@@ -23,6 +23,7 @@ on:
           debian-bookworm
           ubuntu-focal
           ubuntu-jammy
+          ubuntu-noble
       ref:
         description: git ref to checkout
         type: string
@@ -76,6 +77,7 @@ jobs:
       pkghashes-debian-bookworm: ${{ steps.pkghashes.outputs.pkghashes-debian-bookworm }}
       pkghashes-ubuntu-focal: ${{ steps.pkghashes.outputs.pkghashes-ubuntu-focal }}
       pkghashes-ubuntu-jammy: ${{ steps.pkghashes.outputs.pkghashes-ubuntu-jammy }}
+      pkghashes-ubuntu-noble: ${{ steps.pkghashes.outputs.pkghashes-ubuntu-noble }}
       srchashes: ${{ steps.srchashes.outputs.srchashes }}
     steps:
       - uses: actions/checkout@v4
index 0e680324b41c47eec64879c5aa00e68152f1b678..c478118413ba320883f6dcf9e9dbca033016bbc2 100644 (file)
@@ -24,6 +24,7 @@ on:
           debian-bookworm
           ubuntu-focal
           ubuntu-jammy
+          ubuntu-noble
       ref:
         description: git ref to checkout
         type: string
index f83f9b71f5200e16a7c785c0c1c4b84c2d5a7d0f..d22d274ead892cbbc40745375d0f034682ad0c41 100644 (file)
@@ -130,17 +130,17 @@ struct InternalQueryState
   }
 
   boost::optional<Netmask> subnet{boost::none}; // 40
+  std::string poolName; // 32
   ComboAddress origRemote; // 28
   ComboAddress origDest; // 28
   ComboAddress hopRemote;
   ComboAddress hopLocal;
   DNSName qname; // 24
-  std::string poolName; // 24
-  StopWatch queryRealTime{true}; // 24
-  std::shared_ptr<DNSDistPacketCache> packetCache{nullptr}; // 16
 #ifdef HAVE_XSK
-  PacketBuffer xskPacketHeader; // 8
+  PacketBuffer xskPacketHeader; // 24
 #endif /* HAVE_XSK */
+  StopWatch queryRealTime{true}; // 24
+  std::shared_ptr<DNSDistPacketCache> packetCache{nullptr}; // 16
   std::unique_ptr<DNSCryptQuery> dnsCryptQuery{nullptr}; // 8
   std::unique_ptr<QTag> qTag{nullptr}; // 8
   std::unique_ptr<PacketBuffer> d_packet{nullptr}; // Initial packet, so we can restart the query from the response path if needed // 8
@@ -150,9 +150,9 @@ struct InternalQueryState
   ClientState* cs{nullptr}; // 8
   std::unique_ptr<DOHUnitInterface> du; // 8
   size_t d_proxyProtocolPayloadSize{0}; // 8
-  int32_t d_streamID{-1}; // 4
   std::unique_ptr<DOQUnit> doqu{nullptr}; // 8
   std::unique_ptr<DOH3Unit> doh3u{nullptr}; // 8
+  int32_t d_streamID{-1}; // 4
   uint32_t cacheKey{0}; // 4
   uint32_t cacheKeyNoECS{0}; // 4
   // DoH-only */
index 56c9954643640ec42bd918a62fd0dfcd440e0cf9..c20d2876ee0df4e0a1ff94af4a862b004e977a11 100644 (file)
@@ -857,6 +857,15 @@ static void dumpTrace(const string& trace, const timeval& timev)
   if (trace.empty()) {
     return;
   }
+  if (t_tracefd < 0) {
+    std::istringstream buf(trace);
+    g_log << Logger::Warning << "=== START OF FAIL TRACE ====" << endl;
+    for (string line; std::getline(buf, line);) {
+      g_log << Logger::Warning << line << endl;
+    }
+    g_log << Logger::Warning << "=== END OF FAIL TRACE ====" << endl;
+    return;
+  }
   timeval now{};
   Utility::gettimeofday(&now);
   int traceFd = dup(t_tracefd);
diff --git a/regression-tests.recursor-dnssec/test_TraceFail.py b/regression-tests.recursor-dnssec/test_TraceFail.py
new file mode 100644 (file)
index 0000000..52e8c29
--- /dev/null
@@ -0,0 +1,48 @@
+import dns
+import os
+import time
+import subprocess
+from recursortests import RecursorTest
+
+class testTraceFail(RecursorTest):
+    _confdir = 'TraceFail'
+
+    _config_template = """
+trace=fail
+forward-zones-recurse=.=127.0.0.1:9999
+"""
+
+    @classmethod
+    def setUpClass(cls):
+
+        # we don't need all the auth stuff
+        cls.setUpSockets()
+        cls.startResponders()
+
+        confdir = os.path.join('configs', cls._confdir)
+        cls.createConfigDir(confdir)
+
+        cls.generateRecursorConfig(confdir)
+        cls.startRecursor(confdir, cls._recursorPort)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.tearDownRecursor()
+
+    def testA(self):
+        query = dns.message.make_query('example', 'A', want_dnssec=False)
+        res = self.sendUDPQuery(query)
+        self.assertRcodeEqual(res, dns.rcode.SERVFAIL)
+
+        grepCmd = ['grep', 'END OF FAIL TRACE', 'configs/' + self._confdir + '/recursor.log']
+        ret = b''
+        for i in range(10):
+            time.sleep(1)
+            try:
+                ret = subprocess.check_output(grepCmd, stderr=subprocess.STDOUT)
+            except subprocess.CalledProcessError as e:
+                continue
+            print(b'A' + ret)
+            break
+        print(ret)
+        self.assertNotEqual(ret, b'')
index a801a25c8f51b5062ebc1b41587374721c0d9302..abf9a51cccc3ec85f96ba139b697c834956aeba1 100644 (file)
@@ -15,6 +15,23 @@ dnssec=validate
 zoneToCache(".", "axfr", "193.0.14.129") -- k-root
 """
 
+    @classmethod
+    def setUpClass(cls):
+
+        # we don't need all the auth stuff
+        cls.setUpSockets()
+        cls.startResponders()
+
+        confdir = os.path.join('configs', cls._confdir)
+        cls.createConfigDir(confdir)
+
+        cls.generateRecursorConfig(confdir)
+        cls.startRecursor(confdir, cls._recursorPort)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.tearDownRecursor()
+
     def testZTC(self):
         grepCmd = ['grep', 'validationStatus="Secure"', 'configs/' + self._confdir + '/recursor.log']
         ret = b''