]> git.ipfire.org Git - thirdparty/pdns.git/log
thirdparty/pdns.git
3 months agodnsdist: Gracefully handle timeout/response for a closed HTTP stream 15485/head
Remi Gacogne [Mon, 28 Apr 2025 10:47:39 +0000 (12:47 +0200)] 
dnsdist: Gracefully handle timeout/response for a closed HTTP stream

The remote end might very well have already closed the HTTP stream
corresponding to the timeout or response we are processing. While
this means we need to discard the event we were processing, it is
not an unexpected event and we should thus not raise an exception
since the caller cannot do anything about it.

(cherry picked from commit c3aab4cebf70815578e8bf449a7bce9d0827289e)

3 months agoMerge pull request #15482 from rgacogne/ddist19-backport-15480
Remi Gacogne [Tue, 29 Apr 2025 08:35:49 +0000 (10:35 +0200)] 
Merge pull request #15482 from rgacogne/ddist19-backport-15480

dnsdist-1.9.x: Backport of 15480 - Fix a crash when processing timeouts for incoming DoH queries

3 months agodnsdist: Fix a crash when processing timeouts for incoming DoH queries 15482/head
Remi Gacogne [Mon, 28 Apr 2025 10:41:00 +0000 (12:41 +0200)] 
dnsdist: Fix a crash when processing timeouts for incoming DoH queries

This commit fixes a double-free triggered by an exception being raised
while we are processing a timeout for an incoming DoH query. The exception
bypasses the call releasing the smart pointer, and thus the destructor
is called when we reach the end of the function since we own the smart
pointer, but unfortunately it has already been destroyed by the function
that raised the exception. The fix is to release the pointer first,
then call the function, so even if an exception is raised we no longer
own the pointer, and it's clear that the function has taken ownership of it.

(cherry picked from commit 954eb1921699147b16f8bcd08029e37da3e789b9)

3 months agoMerge pull request #15483 from rgacogne/ddist19-fix-ubuntu-workflows
Remi Gacogne [Tue, 29 Apr 2025 08:07:58 +0000 (10:07 +0200)] 
Merge pull request #15483 from rgacogne/ddist19-fix-ubuntu-workflows

dnsdist-1.9.x: Switch ubuntu-20.04 workflows to 24.04

3 months agodnsdist-1.9.x: Remove the source code format check workflow 15483/head
Remi Gacogne [Tue, 29 Apr 2025 07:29:36 +0000 (09:29 +0200)] 
dnsdist-1.9.x: Remove the source code format check workflow

3 months agodnsdist-1.9.x: Update the formatting workflow for Ubuntu 24.04
Remi Gacogne [Mon, 28 Apr 2025 12:41:01 +0000 (14:41 +0200)] 
dnsdist-1.9.x: Update the formatting workflow for Ubuntu 24.04

3 months agodnsdist-1.9.x: Switch ubuntu-20.04 workflows to 24.04
Remi Gacogne [Mon, 28 Apr 2025 12:34:49 +0000 (14:34 +0200)] 
dnsdist-1.9.x: Switch ubuntu-20.04 workflows to 24.04

5 months agoMerge pull request #15183 from rgacogne/ddist19-backport-15118
Remi Gacogne [Thu, 20 Feb 2025 11:44:16 +0000 (12:44 +0100)] 
Merge pull request #15183 from rgacogne/ddist19-backport-15118

dnsdist-1.9.x: Handle Quiche >= 0.23.0 since the API changed

5 months agoMerge pull request #15181 from rgacogne/ddist19-backport-15137
Remi Gacogne [Thu, 20 Feb 2025 11:44:05 +0000 (12:44 +0100)] 
Merge pull request #15181 from rgacogne/ddist19-backport-15137

dnsdist-1.9.x: Backport of 15137 Fix compatibility with boost::lockfree >= 1.87.0

5 months agoMerge pull request #15182 from rgacogne/ddist19-backport-15164
Remi Gacogne [Thu, 20 Feb 2025 11:13:56 +0000 (12:13 +0100)] 
Merge pull request #15182 from rgacogne/ddist19-backport-15164

dnsdist-1.9.x: Update Rust to 1.84.1 for our packages

5 months agoRust moved to XZ compression 15182/head
Remi Gacogne [Fri, 14 Feb 2025 15:51:37 +0000 (16:51 +0100)] 
Rust moved to XZ compression

(cherry picked from commit 2b152da3e752858406189f5a360d967e8bdd816f)

5 months agodnsdist: Handle Quiche >= 0.23.0 since the API changed 15183/head
Remi Gacogne [Tue, 4 Feb 2025 15:24:08 +0000 (16:24 +0100)] 
dnsdist: Handle Quiche >= 0.23.0 since the API changed

Quiche 0.23.0 has renamed `quiche_h3_event_headers_has_body` to
`quiche_h3_event_headers_has_more_frames`, so we need to handle that.

(cherry picked from commit 35ab1dbe0ab9814445e8be8ba3ab7b719e1b5667)

5 months agodnsdist-1.9.x: Update Rust to 1.84.1 for our packages
Remi Gacogne [Fri, 14 Feb 2025 15:38:33 +0000 (16:38 +0100)] 
dnsdist-1.9.x: Update Rust to 1.84.1 for our packages

(cherry picked from commit 4c6fc13c2a95bd4cf801409d12e54f2a23fa16f1)

5 months agodnsdist-1.9.x: Fix compatibility with boost::lockfree >= 1.87.0 15181/head
Remi Gacogne [Mon, 10 Feb 2025 10:24:28 +0000 (11:24 +0100)] 
dnsdist-1.9.x: Fix compatibility with boost::lockfree >= 1.87.0

In https://github.com/boostorg/lockfree/pull/90 `boost::lockfree::spsc_queue`
introduced moved semantics, which is great, but added restrictions
to the callback functor that did not exist before, breaking the API.
This PR fixes that by updating our callbacks to expect an object
instead of a reference.

(cherry picked from commit 05543aed8ccff2270a65d3f9b75e6e9d894b8b45)

7 months agoMerge pull request #14978 from rgacogne/ddist19-backport-14888 dnsdist-1.9.8
Remi Gacogne [Mon, 16 Dec 2024 15:55:06 +0000 (16:55 +0100)] 
Merge pull request #14978 from rgacogne/ddist19-backport-14888

dnsdist-1.9.x: Backport of 14888 - Custom metrics: better error messages, small doc improvements

7 months agoMerge pull request #14977 from rgacogne/ddist19-backport-14967
Remi Gacogne [Mon, 16 Dec 2024 15:50:09 +0000 (16:50 +0100)] 
Merge pull request #14977 from rgacogne/ddist19-backport-14967

dnsdist-1.9.x: Backport of #14967 -  Fix ECS zero-scope with incoming DoH queries

7 months agoexpand declareMetric text 14978/head
Peter van Dijk [Tue, 26 Nov 2024 09:38:10 +0000 (10:38 +0100)] 
expand declareMetric text

(cherry picked from commit 0ffd83db942bab775a1363a373d5cb01b8455a86)

7 months agofix parameter name, formatting, some typos
Peter van Dijk [Tue, 26 Nov 2024 09:28:32 +0000 (10:28 +0100)] 
fix parameter name, formatting, some typos

(cherry picked from commit a3316c3099c76aa7a21e73479c8e57cc2ff9a9d2)

7 months agoimprove error messages a bit
Peter van Dijk [Tue, 26 Nov 2024 09:25:11 +0000 (10:25 +0100)] 
improve error messages a bit

(cherry picked from commit 8b9d0180585096d2c0ecf959aff1569edc90502b)

7 months agodnsdist: Fix ECS zero-scope with incoming DoH queries 14977/head
Remi Gacogne [Fri, 13 Dec 2024 14:45:31 +0000 (15:45 +0100)] 
dnsdist: Fix ECS zero-scope with incoming DoH queries

The zero-scope feature involves a first cache lookup before the ECS
information has been added to the query, then on a miss a second,
regular lookup is done. When we get a response from the backend that
contains an ECS scope set to 0, we can insert it into the cache in a
way that allows using it for all clients, but we must be careful to
use the key that was computed during the first lookup, and not the
second one.
Incoming DoH queries make that even more interesting because while
they are received over TCP, they are initially forwarded to the
backend over UDP but can be retried over TCP if a TC=1 answer is
received. In that case we must be very careful not to insert the
answer into the cache using the wrong protocol, as we don't want to
serve a TC=1 answer to a client contacting us over TCP, for example.
The computation of the cache key and protocol was unfortunately broken
for the incoming query received over DoH, forwarded over UDP and
response has a zero scope case. This commit fixes it.

(cherry picked from commit 12af2075a86c11ee5441defbfe6695a609cb6eb4)

8 months agoMerge pull request #14887 from rgacogne/ddist19-backport-14850
Remi Gacogne [Fri, 13 Dec 2024 15:36:40 +0000 (16:36 +0100)] 
Merge pull request #14887 from rgacogne/ddist19-backport-14850

dnsdist-1.9.x: Backport of #14850 - add elapsed time to dq object

8 months agoMerge pull request #14929 from rgacogne/ddist19-setWeightedBalancingFactor-zero
Remi Gacogne [Fri, 6 Dec 2024 12:14:01 +0000 (13:14 +0100)] 
Merge pull request #14929 from rgacogne/ddist19-setWeightedBalancingFactor-zero

dnsdist-1.9.x: Allow resetting `setWeightedBalancingFactor()` to zero

8 months agodnsdist: Add a regression tests for whashed and chashed 14929/head
Remi Gacogne [Fri, 6 Dec 2024 10:27:13 +0000 (11:27 +0100)] 
dnsdist: Add a regression tests for whashed and chashed

8 months agodnsdist: Allow resetting `setConsistentHashingBalancingFactor()` to zero
Remi Gacogne [Wed, 4 Dec 2024 14:40:16 +0000 (15:40 +0100)] 
dnsdist: Allow resetting `setConsistentHashingBalancingFactor()` to zero

8 months agodnsdist: Check that we can set setWeightedBalancingFactor to a value > 1.0
Remi Gacogne [Wed, 4 Dec 2024 14:39:39 +0000 (15:39 +0100)] 
dnsdist: Check that we can set setWeightedBalancingFactor to a value > 1.0

8 months agodnsdist: Allow resetting `setWeightedBalancingFactor()` to zero
Remi Gacogne [Wed, 4 Dec 2024 13:39:56 +0000 (14:39 +0100)] 
dnsdist: Allow resetting `setWeightedBalancingFactor()` to zero

Zero is the initial value, but until now it was only possible to pass
a value greater than or equal to 1.0 to `setWeightedBalancingFactor()`
so it was not possible to reset it to the default value.

8 months agoMerge pull request #14877 from rgacogne/ddist19-backport-14764
Remi Gacogne [Tue, 26 Nov 2024 16:16:10 +0000 (17:16 +0100)] 
Merge pull request #14877 from rgacogne/ddist19-backport-14764

dnsdist-1.9.x: Backport of #14764 - add the ability to load a given TLS tickets key

8 months agodnsdist: Fix another clang-tidy warning 14877/head
Remi Gacogne [Tue, 26 Nov 2024 13:17:05 +0000 (14:17 +0100)] 
dnsdist: Fix another clang-tidy warning

8 months agoElapsed lua binding 14887/head
phonedph1 [Wed, 20 Nov 2024 23:08:22 +0000 (16:08 -0700)] 
Elapsed lua binding

(cherry picked from commit d31fa785c5a9e5ba6f9d2d482e79fbf72856aa4b)

8 months agodnsdist: Fix clang-tidy warnings
Remi Gacogne [Tue, 26 Nov 2024 09:05:08 +0000 (10:05 +0100)] 
dnsdist: Fix clang-tidy warnings

8 months agoMerge pull request #14878 from rgacogne/ddist19-backport-14768
Remi Gacogne [Tue, 26 Nov 2024 08:42:47 +0000 (09:42 +0100)] 
Merge pull request #14878 from rgacogne/ddist19-backport-14768

dnsdist-1.9.x: Backport of #14768 - setTicketsKeyAddedHook: pass a std::string to the hook to avoid luawrapper to truncate content at potential null chars

8 months agodnsdist setTicketsKeyAddedHook: pass a std::string to the hook to avoid luawrapper... 14878/head
Charles-Henri Bruyand [Sat, 12 Oct 2024 19:10:36 +0000 (21:10 +0200)] 
dnsdist setTicketsKeyAddedHook: pass a std::string to the hook to avoid luawrapper to truncate content at potential null chars

(cherry picked from commit 227a3dbf96b1c9ab4e6e3814982991be78786248)

8 months agofix Remi's comments and some formatting
Charles-Henri Bruyand [Thu, 10 Oct 2024 10:43:15 +0000 (12:43 +0200)] 
fix Remi's comments and some formatting

(cherry picked from commit c9177f2274ce98a4130d22e2dc47b6326d206086)

8 months agodnsdist: add a global loadTicketsKey function
Charles-Henri Bruyand [Wed, 9 Oct 2024 14:21:27 +0000 (16:21 +0200)] 
dnsdist: add a global loadTicketsKey function

(cherry picked from commit eb8748356f51bec98dd0626e18627d2552858d07)

8 months agodnsdist: add the ability to load a given tickets key from lua
Charles-Henri Bruyand [Fri, 14 Jun 2024 11:53:27 +0000 (13:53 +0200)] 
dnsdist: add the ability to load a given tickets key from lua

(cherry picked from commit 0de40340927b6943a44728407fd2f1cc93c38e51)

8 months agoMerge pull request #14874 from romeroalx/backport-14862-to-dnsdist-1.9.x
Remi Gacogne [Mon, 25 Nov 2024 08:57:13 +0000 (09:57 +0100)] 
Merge pull request #14874 from romeroalx/backport-14862-to-dnsdist-1.9.x

dnsdist-1.9.x: Backport 14862 - builder: remove ubuntu lunar+mantic as they are EOL

8 months agobuilder: remove ubuntu lunar+mantic as they are EOL 14874/head
Peter van Dijk [Fri, 22 Nov 2024 09:08:40 +0000 (10:08 +0100)] 
builder: remove ubuntu lunar+mantic as they are EOL

10 months agoMerge pull request #14740 from rgacogne/ddist19-backport-14739 dnsdist-1.9.7
Remi Gacogne [Thu, 3 Oct 2024 13:50:42 +0000 (15:50 +0200)] 
Merge pull request #14740 from rgacogne/ddist19-backport-14739

dnsdist-1.9.x: Backport 14739 : Disable eBPF filtering on QUIC (DoQ, DoH3) sockets

10 months agodnsdist: Add more regression tests for eBPF filtering 14740/head
Remi Gacogne [Thu, 3 Oct 2024 08:18:47 +0000 (10:18 +0200)] 
dnsdist: Add more regression tests for eBPF filtering

(cherry picked from commit 2d9ed74be1fa9ecf1d5fe89ab1c544e7def7c9db)

10 months agodnsdist: Disable eBPF filtering on QUIC (DoQ, DoH3) sockets
Remi Gacogne [Thu, 3 Oct 2024 07:10:09 +0000 (09:10 +0200)] 
dnsdist: Disable eBPF filtering on QUIC (DoQ, DoH3) sockets

The current eBPF code tries to parse the beginning of the DNS payload
to extract the qname for all UDP datagrams, which is not course
not working correctly for QUIC packets. I don't immediately see a way
to identify QUIC packets from our eBPF code, so for now this commit
disables the eBPF filtering feature on QUIC sockets.

(cherry picked from commit 093c0de7bcb357e877adc0993a7f7fe78f55add7)

10 months agoMerge pull request #14716 from rgacogne/ddist19-backport-14664
Remi Gacogne [Mon, 30 Sep 2024 13:33:58 +0000 (15:33 +0200)] 
Merge pull request #14716 from rgacogne/ddist19-backport-14664

dnsdist-1.9.x: Backport 14664 - Add a FFI accessor to incoming proxy protocol values

10 months agoMerge pull request #14730 from rgacogne/ddist19-backport-14728
Remi Gacogne [Mon, 30 Sep 2024 12:30:13 +0000 (14:30 +0200)] 
Merge pull request #14730 from rgacogne/ddist19-backport-14728

dnsdist-1.9.x: Backport 14728 - Add EDNS to responses generated from raw record data

10 months agodnsdist: Add EDNS to responses generated from raw record data 14730/head
Remi Gacogne [Mon, 30 Sep 2024 10:01:27 +0000 (12:01 +0200)] 
dnsdist: Add EDNS to responses generated from raw record data

My reasoning is that it makes sense to add EDNS to responses generated
from DNSdist provided that:
- the initial query had EDNS
- `setAddEDNSToSelfGeneratedResponses` has not been set to `false`
- we are only provided part of the response and not a full response
  packet

(cherry picked from commit cae561a92410c29053e297bc99d6cb5000665245)

10 months agodnsdist: Apply Otto's suggestion to the Lua FFI proxy protocol API 14716/head
Remi Gacogne [Wed, 25 Sep 2024 13:12:09 +0000 (15:12 +0200)] 
dnsdist: Apply Otto's suggestion to the Lua FFI proxy protocol API

(cherry picked from commit 70530852d01f6c96606ff6d27c9487238c2cf95c)

10 months agodnsdist: Add regression tests for the proxy protocol TLV FFI accessor
Remi Gacogne [Tue, 17 Sep 2024 08:52:43 +0000 (10:52 +0200)] 
dnsdist: Add regression tests for the proxy protocol TLV FFI accessor

(cherry picked from commit 887c33374040533c04179e469fe6f80956f12117)

10 months agodnsdist: Add unit tests for the proxy protocol TLV FFI accessor
Remi Gacogne [Tue, 17 Sep 2024 08:52:06 +0000 (10:52 +0200)] 
dnsdist: Add unit tests for the proxy protocol TLV FFI accessor

(cherry picked from commit 00bb88d7a0df28e740ccbebc202ef6fe4a982243)

10 months agodnsdist: Add a FFI accessor to incoming proxy protocol values
Remi Gacogne [Thu, 12 Sep 2024 15:42:08 +0000 (17:42 +0200)] 
dnsdist: Add a FFI accessor to incoming proxy protocol values

(cherry picked from commit b546bc866551dfb1d0099b32d72826d76dc3a168)

10 months agoMerge pull request #14677 from rgacogne/ddist19-backport-14671
Remi Gacogne [Mon, 23 Sep 2024 12:28:58 +0000 (14:28 +0200)] 
Merge pull request #14677 from rgacogne/ddist19-backport-14671

dnsdist-1.9.x: Backport 14671 - Always store the `OpenSSLTLSIOCtx` in the connection

10 months agoMerge pull request #14695 from rgacogne/ddist19-update-rust-1.78
Remi Gacogne [Fri, 20 Sep 2024 09:25:38 +0000 (11:25 +0200)] 
Merge pull request #14695 from rgacogne/ddist19-update-rust-1.78

dnsdist-1.9.x: Update the Rust version we use in our packages to 1.78

10 months agodnsdist: Update the Rust version we use in our packages to 1.78 14695/head
Remi Gacogne [Fri, 20 Sep 2024 08:51:34 +0000 (10:51 +0200)] 
dnsdist: Update the Rust version we use in our packages to 1.78

The `boring-sys` crate used by `Quiche` uses a version of the
`bindgen` crate that requires `Rust >= 1.77.0`.

10 months agodnsdist: One additional clang-tidy fix 14677/head
Remi Gacogne [Tue, 17 Sep 2024 14:53:19 +0000 (16:53 +0200)] 
dnsdist: One additional clang-tidy fix

10 months agodnsdist: Fix clang-tidy warnings
Remi Gacogne [Fri, 13 Sep 2024 14:38:16 +0000 (16:38 +0200)] 
dnsdist: Fix clang-tidy warnings

(cherry picked from commit afcd4ccefb73efbf025b2f910a6506e18b4cf116)

10 months agodnsdist: Always store the OpenSSLTLSIOCtx in the connection
Remi Gacogne [Fri, 13 Sep 2024 13:57:38 +0000 (15:57 +0200)] 
dnsdist: Always store the OpenSSLTLSIOCtx in the connection

(cherry picked from commit 6aac1f054fe6253fe3b051d5c7e3f78a71547e4e)

11 months agoMerge pull request #14640 from rgacogne/ddist19-backport-14575
Remi Gacogne [Tue, 10 Sep 2024 09:41:01 +0000 (11:41 +0200)] 
Merge pull request #14640 from rgacogne/ddist19-backport-14575

dnsdist-1.9.x: Backport 14575 - Handle a non-existent default pool when removing a server

11 months agoMerge pull request #14647 from rgacogne/ddist19-backport-14529
Remi Gacogne [Tue, 10 Sep 2024 09:40:13 +0000 (11:40 +0200)] 
Merge pull request #14647 from rgacogne/ddist19-backport-14529

dnsdist-1.9.x: Backport 14529 - Update Quiche to 0.22.0 (in our packages)

11 months agoMerge pull request #14646 from rgacogne/ddist19-backport-14534
Remi Gacogne [Tue, 10 Sep 2024 09:40:04 +0000 (11:40 +0200)] 
Merge pull request #14646 from rgacogne/ddist19-backport-14534

dnsdist-1.9.x: Backport 14534 - Add warnings about large values passed to `setMaxTCPClientThreads`

11 months agoMerge pull request #14645 from rgacogne/ddist19-backport-14550
Remi Gacogne [Tue, 10 Sep 2024 09:39:21 +0000 (11:39 +0200)] 
Merge pull request #14645 from rgacogne/ddist19-backport-14550

dnsdist-1.9.x: Backport 14550 - json11: add include for cstdint

11 months agoMerge pull request #14644 from rgacogne/ddist19-backport-14569
Remi Gacogne [Tue, 10 Sep 2024 09:39:14 +0000 (11:39 +0200)] 
Merge pull request #14644 from rgacogne/ddist19-backport-14569

dnsdist-1.9.x: Backport 14569 - Fix EDNS flags confusion when editing the OPT header

11 months agoMerge pull request #14643 from rgacogne/ddist-19-backport-14570
Remi Gacogne [Tue, 10 Sep 2024 09:38:54 +0000 (11:38 +0200)] 
Merge pull request #14643 from rgacogne/ddist-19-backport-14570

dnsdist-1.9.x: Backport 14570 - Return a valid unix timestamp for Dynamic Block's `until`

11 months agoMerge pull request #14641 from rgacogne/ddist19-backport-14573
Remi Gacogne [Tue, 10 Sep 2024 09:38:44 +0000 (11:38 +0200)] 
Merge pull request #14641 from rgacogne/ddist19-backport-14573

dnsdist-1.9.x: Backport 14573 - Stop reporting timeouts in `topSlow()`, add `topTimeouts()`

11 months agoMerge pull request #14639 from rgacogne/ddist19-14636
Remi Gacogne [Tue, 10 Sep 2024 09:38:31 +0000 (11:38 +0200)] 
Merge pull request #14639 from rgacogne/ddist19-14636

dnsdist-1.9.x: Backport #14636 - Fix handling of proxy protocol payload outside of TLS for DoT

11 months agoMerge pull request #14638 from rgacogne/ddist19-backport-14562
Remi Gacogne [Tue, 10 Sep 2024 09:38:23 +0000 (11:38 +0200)] 
Merge pull request #14638 from rgacogne/ddist19-backport-14562

dnsdist-1.9.x: Backport 14562 - Fix build with boost 1.86.0

11 months agodnsdist: Deduplicate the Quiche installation steps 14647/head
Remi Gacogne [Tue, 20 Aug 2024 13:38:09 +0000 (15:38 +0200)] 
dnsdist: Deduplicate the Quiche installation steps

(cherry picked from commit 193729391c26190458c03dca613c02fb4beb56be)

11 months agodnsdist: Disable `SONAME` support in Quiche
Remi Gacogne [Fri, 19 Jul 2024 12:12:01 +0000 (14:12 +0200)] 
dnsdist: Disable `SONAME` support in Quiche

Since 0.22.0 Quiche sets a proper `SONAME`

See https://github.com/cloudflare/quiche/pull/1769

but it does not matter in our case since we install
the Quiche library in such a way (libdnsdist-quiche.so)
that we are the only user, and it will always be updated
with DNSdist. Keeping it makes our life significantly harder
since several packaging tools look a the `SONAME`.

(cherry picked from commit cce2be27bb5a15d28f75349b5d87e31aabd85e09)

11 months agodnsdist: Update Quiche to 0.22.0 (in our packages)
Remi Gacogne [Mon, 15 Jul 2024 08:24:03 +0000 (10:24 +0200)] 
dnsdist: Update Quiche to 0.22.0 (in our packages)

(cherry picked from commit 13ae54d539f26a8e37272e2df246709a93e8c23f)

11 months agodnsdist: Add warnings about large values passed to `setMaxTCPClientThreads` 14646/head
Remi Gacogne [Mon, 29 Jul 2024 10:44:03 +0000 (12:44 +0200)] 
dnsdist: Add warnings about large values passed to `setMaxTCPClientThreads`

(cherry picked from commit 78fb94b462b8e9fc3d980b8de8afe25960a1b979)

11 months agojson11: add include for cstdint 14645/head
Peter van Dijk [Fri, 9 Aug 2024 17:41:46 +0000 (19:41 +0200)] 
json11: add include for cstdint

fixes #14549, which came with a patch

(cherry picked from commit 8d6d32bef74aa2cba41421645936fade35c71c72)

11 months agodnsdist: Fix EDNS flags confusion when editing the OPT header 14644/head
Remi Gacogne [Tue, 20 Aug 2024 10:26:33 +0000 (12:26 +0200)] 
dnsdist: Fix EDNS flags confusion when editing the OPT header

We used to wrongly reverse the byte-ordering of the existing EDNS
flags when editing the OPT header, for example when setting an
extended DNS error status.

(cherry picked from commit 010521a0197091642bbc654b2b371b462fa73033)

11 months agodnsdist: Take nanoseconds into account in `DynBlock`'s `until` accessor 14643/head
Remi Gacogne [Tue, 20 Aug 2024 13:14:45 +0000 (15:14 +0200)] 
dnsdist: Take nanoseconds into account in `DynBlock`'s `until` accessor

(cherry picked from commit 23bea0c4486ee30b10d1d00a50244de49b970112)

11 months agodnsdist: Return a valid unix timestamp for Dynamic Block's `until`
Remi Gacogne [Tue, 20 Aug 2024 11:04:11 +0000 (13:04 +0200)] 
dnsdist: Return a valid unix timestamp for Dynamic Block's `until`

We internally use a timestamp obtained via `CLOCK_MONOTONIC` which
is quite useless to an external observer, so convert it to a normal
unix timestamp in the Lua accessor.

(cherry picked from commit 8cb758ae0c791866f8a6a4f76e41470754d04316)

11 months agodnsdist: Stop reporting timeouts in `topSlow()`, add `topTimeouts()` 14641/head
Remi Gacogne [Tue, 20 Aug 2024 12:44:57 +0000 (14:44 +0200)] 
dnsdist: Stop reporting timeouts in `topSlow()`, add `topTimeouts()`

Until this commit `topSlow()` returned queries that timed out, which
is not very helpful. This was happening because timeouts are internally
recorded with a very high response time.
With this change, `topSlow()` now ignores queries that timed out, and
a new command is added to look into these: `topTimeouts()`.

(cherry picked from commit 49243aa47ffc4162a44d2badfdcbad3f6c5c8fd7)

11 months agodnsdist: Create the default pool early, before parsing the configuration 14640/head
Remi Gacogne [Wed, 21 Aug 2024 08:51:27 +0000 (10:51 +0200)] 
dnsdist: Create the default pool early, before parsing the configuration

(cherry picked from commit e9da418978236be775ee39aca49b71afce52f645)

11 months agodnsdist: Handle non-existent default pool when removing a server
Remi Gacogne [Wed, 21 Aug 2024 08:50:36 +0000 (10:50 +0200)] 
dnsdist: Handle non-existent default pool when removing a server

(cherry picked from commit 7faceb1faf44dc117f8405bb8ea42185beef65a7)

11 months agoFix build with boost 1.86.0 14638/head
Michael Cho [Fri, 16 Aug 2024 02:49:17 +0000 (22:49 -0400)] 
Fix build with boost 1.86.0

Boost 1.86.0 changes seem to no longer indirectly include header which
causes build to fail with:
```
uuid-utils.cc:38:58:
error: 'random' is not a class, namespace, or enumeration
```

boost/random/mersenne_twister.hpp has been available since Boost 1.21.2

(cherry picked from commit eed56000b1d68ac083b8e8bea4ff0ea30a1579c4)

11 months agodnsdist: Fix handling of proxy protocol payload outside of TLS for DoT 14639/head
Remi Gacogne [Mon, 9 Sep 2024 12:20:48 +0000 (14:20 +0200)] 
dnsdist: Fix handling of proxy protocol payload outside of TLS for DoT

After reading the proxy protocol payload from the I/O buffer
we were clearing the buffer but failed to properly reset the
position, leading to an exception when trying to read the DNS
payload after processing the TLS handshake:

```
Got an exception while handling (reading) TCP query from 127.0.0.1:59426: Calling tryRead() with a too small buffer (2) for a read of 18446744073709551566 bytes starting at 52
```

The huge value comes from the fact that the position (52 here)
is larger than the size of the buffer (2 at this point to read
the size of the incoming DNS payload), leading to an unsigned
underflow. The code is properly detecting that the value makes
no sense in this context, but the connection is then dropped
because we cannot recover.

It turns out we had a end-to-end test for the "proxy protocol
outside of TLS" case but only over incoming DoH, and the DoH
case avoids this specific issue because the buffer is always
properly resized, and the position updated.

(cherry picked from commit 4931fb28f7bc6e8905d3298003dead7c32f4d090)

12 months agoMerge pull request #14492 from omoerbeek/backport-14486-to-dnsdist-1.9.x
Remi Gacogne [Thu, 18 Jul 2024 08:04:52 +0000 (10:04 +0200)] 
Merge pull request #14492 from omoerbeek/backport-14486-to-dnsdist-1.9.x

dnsdist: Backport 14486 to dnsdist 1.9.x: pin pysnmp to version 5 for regression tests

12 months agoAlso pin pysnmp version for dnsdist regression tests 14492/head
Otto Moerbeek [Wed, 17 Jul 2024 12:44:11 +0000 (14:44 +0200)] 
Also pin pysnmp version for dnsdist regression tests

(cherry picked from commit 5d3db32982e7a06a9e653529baa2fb67e24d7189)

12 months agorec: pin pysnmp to version 5 for regression tests
Otto Moerbeek [Wed, 17 Jul 2024 12:03:32 +0000 (14:03 +0200)] 
rec: pin pysnmp to version 5 for regression tests

(cherry picked from commit 4d44d3076051fe27ee91e847a3600ad19c44fd72)

13 months agoMerge pull request #14436 from rgacogne/ddist19-xsk-backend-race dnsdist-1.9.6
Remi Gacogne [Fri, 12 Jul 2024 11:28:15 +0000 (13:28 +0200)] 
Merge pull request #14436 from rgacogne/ddist19-xsk-backend-race

dnsdist-1.9.x: Backport 14429 - Fix a race in the XSK/AF_XDP backend handling code

13 months agodnsdist: Avoid a double lookup when UMEM state debugging is enabled 14436/head
Remi Gacogne [Fri, 12 Jul 2024 09:49:44 +0000 (11:49 +0200)] 
dnsdist: Avoid a double lookup when UMEM state debugging is enabled

(cherry picked from commit b9d38d08195fa8c04da16ccd4580778499993a4e)

13 months agoMerge pull request #14466 from omoerbeek/backport-14445-to-dnsdist-1.9.x
Otto Moerbeek [Fri, 12 Jul 2024 09:46:07 +0000 (11:46 +0200)] 
Merge pull request #14466 from omoerbeek/backport-14445-to-dnsdist-1.9.x

dnsdist: Backport 14445 to dnsdist 1.9.x: use el-7 for daily build

13 months agorec 4.9.x: daily build for el-7 instead of centos-7 14466/head
Otto Moerbeek [Tue, 9 Jul 2024 08:19:07 +0000 (10:19 +0200)] 
rec 4.9.x: daily build for el-7 instead of centos-7

(cherry picked from commit 8a0e619a2a7d027d24e26fb23ecade0573592382)

13 months agodnsdist: Set the shared XSK frames in the XskWorker constructor
Remi Gacogne [Fri, 12 Jul 2024 07:41:53 +0000 (09:41 +0200)] 
dnsdist: Set the shared XSK frames in the XskWorker constructor

(cherry picked from commit ae2d10d1c3eae6e5351a3914926bcf951db3fbfd)

13 months agoMerge pull request #14449 from rgacogne/ddist19-backport-14327
Remi Gacogne [Thu, 11 Jul 2024 07:21:21 +0000 (09:21 +0200)] 
Merge pull request #14449 from rgacogne/ddist19-backport-14327

dnsdist-1.9.x: Backport 14327 - add support for a callback when a new tickets key is added

13 months agoMerge pull request #14452 from rgacogne/ddist19-backport-14431
Remi Gacogne [Thu, 11 Jul 2024 07:21:07 +0000 (09:21 +0200)] 
Merge pull request #14452 from rgacogne/ddist19-backport-14431

dnsdist-1.9.x: Backport 14431 - Don't include openssl/engine.h if it's not going to be used

13 months agoFix compile error on OPENSSL_VERSION_MAJOR < 3 14449/head
Otto Moerbeek [Thu, 4 Jul 2024 11:56:21 +0000 (13:56 +0200)] 
Fix compile error on OPENSSL_VERSION_MAJOR < 3

../pdns/libssl.cc:637:28: error: no member named 'content' in 'OpenSSLTLSTicketKey'

(cherry picked from commit b1f09edc04813ecb9e70f17834ad9796432201cd)

13 months agoMerge pull request #14446 from rgacogne/ddist19-backport-14400
Remi Gacogne [Tue, 9 Jul 2024 10:53:12 +0000 (12:53 +0200)] 
Merge pull request #14446 from rgacogne/ddist19-backport-14400

dnsdist-1.9.x: Backport 14400 - Switch el7 builds to Oracle Linux 7

13 months agoMerge pull request #14450 from rgacogne/ddist19-backport-14392
Remi Gacogne [Tue, 9 Jul 2024 10:53:04 +0000 (12:53 +0200)] 
Merge pull request #14450 from rgacogne/ddist19-backport-14392

dnsdist-1.9.x: Backport of 14392 - Handle Quiche >= 0.22.0

13 months agoDon't include openssl/engine.h if it's not going to be used 14452/head
Sander Hoentjen [Fri, 5 Jul 2024 14:38:12 +0000 (16:38 +0200)] 
Don't include openssl/engine.h if it's not going to be used

(cherry picked from commit ed4ee5924b14e263d79bd682cdd0ce48758b12df)

13 months agodnsdist: Handle Quiche >= 0.22.0 14450/head
Remi Gacogne [Thu, 27 Jun 2024 14:07:20 +0000 (16:07 +0200)] 
dnsdist: Handle Quiche >= 0.22.0

Quiche broke its existing API in 0.22.0: https://github.com/cloudflare/quiche/pull/1726
This pull request adds m4 code to detect whether the Quiche version
we are building against is >= 0.22.0, and if it is defines
`HAVE_QUICHE_STREAM_ERROR_CODES` which is later used by the code
using Quiche to know which version of the API to use.

(cherry picked from commit e15b9be22b119ca3ab2d717c34d282f4e02b8cbe)

13 months agodnsdist: Use a narrower scope for tickets_key_added_hook
Remi Gacogne [Thu, 4 Jul 2024 10:09:51 +0000 (12:09 +0200)] 
dnsdist: Use a narrower scope for tickets_key_added_hook

(cherry picked from commit 2eca15eae83a1ef6b5d260a8b183a40f95d94a4f)

13 months agodnsdist: Use a recursive mutex for the Lua lock
Remi Gacogne [Wed, 3 Jul 2024 12:25:39 +0000 (14:25 +0200)] 
dnsdist: Use a recursive mutex for the Lua lock

(cherry picked from commit c16a1d43163235e883c13392964b5833c9acac4e)

13 months agodnsdist: fix build of dnsdist least version
Charles-Henri Bruyand [Wed, 3 Jul 2024 11:23:30 +0000 (13:23 +0200)] 
dnsdist: fix build of dnsdist least version

(cherry picked from commit bb202aac1e41fbf4aa0b069e21da6911bf0bd96d)

13 months agodnsdist: fix gnutls lib flags
Charles-Henri Bruyand [Wed, 3 Jul 2024 11:22:57 +0000 (13:22 +0200)] 
dnsdist: fix gnutls lib flags

(cherry picked from commit 43dc130a656def2522b62b0c2287241ad30db3f3)

13 months agodndist: apply Remi's comments, thanks
Charles-Henri Bruyand [Tue, 2 Jul 2024 13:41:18 +0000 (15:41 +0200)] 
dndist: apply Remi's comments, thanks

(cherry picked from commit 0ace84568a6562d9cfbe1e2925029b7351cf654c)

13 months agotidy
Charles-Henri Bruyand [Fri, 28 Jun 2024 08:52:01 +0000 (10:52 +0200)] 
tidy

(cherry picked from commit 3b66414c2abe313ed1ebc9e1faf373f637c47466)

13 months agodnsdist: make sure to acquire lua context lock before calling TicketsKeyAdded callback
Charles-Henri Bruyand [Fri, 28 Jun 2024 08:26:49 +0000 (10:26 +0200)] 
dnsdist: make sure to acquire lua context lock before calling TicketsKeyAdded callback

(cherry picked from commit 2e4e15de32c317ab1f7533699e8bb33aef4bc94d)

13 months agodnsdist: move the setTicketsKeyAddedHook to a unique callback for every tls context
Charles-Henri Bruyand [Thu, 27 Jun 2024 13:02:39 +0000 (15:02 +0200)] 
dnsdist: move the setTicketsKeyAddedHook to a unique callback for every tls context

(cherry picked from commit 195f89a7c59d2ce92790debad191b97f410def0c)

13 months agodnsdist: add support for a callback when a new tickets key is added to the tls context
Charles-Henri Bruyand [Fri, 14 Jun 2024 15:34:04 +0000 (17:34 +0200)] 
dnsdist: add support for a callback when a new tickets key is added to the tls context

(cherry picked from commit 3cf627ae17f7d677615b2b5325c6923a858378ed)

13 months agoswitch el7 builds to Oracle Linux 7 14446/head
Peter van Dijk [Tue, 2 Jul 2024 09:19:31 +0000 (11:19 +0200)] 
switch el7 builds to Oracle Linux 7

(cherry picked from commit 73a1b98f92c671c590540ac19d74d70499f89066)