]> git.ipfire.org Git - thirdparty/pdns.git/log
thirdparty/pdns.git
4 days agogh actions build-packages: avoid duplicates download-artifacts action. Fix publications 16406/head
romeroalx [Tue, 28 Oct 2025 11:53:44 +0000 (12:53 +0100)] 
gh actions build-packages: avoid duplicates download-artifacts action. Fix publications

4 days agogh actions: upload packages to an additional repository
romeroalx [Fri, 7 Mar 2025 07:00:19 +0000 (08:00 +0100)] 
gh actions: upload packages to an additional repository

2 weeks agoMerge pull request #16345 from rgacogne/ddist20-backport-16230
Remi Gacogne [Wed, 22 Oct 2025 13:48:03 +0000 (15:48 +0200)] 
Merge pull request #16345 from rgacogne/ddist20-backport-16230

dnsdist-2.0.x: Backport 16230 - luawrapper: don't segfault on failure in traceback handler

2 weeks agoMerge pull request #16328 from rgacogne/ddist20-backport-15794
Remi Gacogne [Wed, 22 Oct 2025 13:05:36 +0000 (15:05 +0200)] 
Merge pull request #16328 from rgacogne/ddist20-backport-15794

dnsdist-2.0.x: Backport 15794 - Add a selector to match the incoming protocol

2 weeks agoMerge pull request #16327 from rgacogne/ddist20-backport-16140
Remi Gacogne [Wed, 22 Oct 2025 13:05:17 +0000 (15:05 +0200)] 
Merge pull request #16327 from rgacogne/ddist20-backport-16140

dnsdist-2.0.x: Backport 16140 - Fix reentry issue in TCP downstream I/O on macOS/BSD

2 weeks agoMerge pull request #16326 from rgacogne/ddist20-backport-16144
Remi Gacogne [Wed, 22 Oct 2025 13:05:03 +0000 (15:05 +0200)] 
Merge pull request #16326 from rgacogne/ddist20-backport-16144

dnsdist-2.0.x: Backport 16144 - Initialize hash perturbation later, and only if needed

2 weeks agoMerge pull request #16325 from rgacogne/ddist20-backport-16178
Remi Gacogne [Wed, 22 Oct 2025 13:04:50 +0000 (15:04 +0200)] 
Merge pull request #16325 from rgacogne/ddist20-backport-16178

dnsdist-2.0.x: Backport 16178 - Fix setting meta keys on response, pass them from question to response

2 weeks agoMerge pull request #16324 from rgacogne/ddist20-backport-16180
Remi Gacogne [Wed, 22 Oct 2025 13:04:37 +0000 (15:04 +0200)] 
Merge pull request #16324 from rgacogne/ddist20-backport-16180

dnsdist-2.0.x: Backport 16180 - Fix release builds by updating the locked Rust lib version

2 weeks agoMerge pull request #16322 from rgacogne/ddist20-backport-16238
Remi Gacogne [Wed, 22 Oct 2025 13:04:25 +0000 (15:04 +0200)] 
Merge pull request #16322 from rgacogne/ddist20-backport-16238

dnsdist-2.0.x: Backport 16238 - Properly handle exceptions when processing timeout rules

2 weeks agoMerge pull request #16320 from rgacogne/ddist20-backport-16241
Remi Gacogne [Tue, 21 Oct 2025 13:28:38 +0000 (15:28 +0200)] 
Merge pull request #16320 from rgacogne/ddist20-backport-16241

dnsdist-2.0.x: Backport 16241 - Make the round-robin LB policy internal counter atomic

2 weeks agoluawrapper: don't segfault on failure in traceback handler 16345/head
Peter van Dijk [Thu, 9 Oct 2025 11:41:29 +0000 (13:41 +0200)] 
luawrapper: don't segfault on failure in traceback handler

Signed-off-by: Peter van Dijk <peter.van.dijk@powerdns.com>
(cherry picked from commit 3e12d56c5491618688d5166ce1d4741e34b37be9)

2 weeks agoMerge pull request #16309 from rgacogne/ddist20-backport-16292
Remi Gacogne [Tue, 21 Oct 2025 12:35:05 +0000 (14:35 +0200)] 
Merge pull request #16309 from rgacogne/ddist20-backport-16292

dnsdist-2.0.x: Backport 16292 - Fix query rules bypass after tagging from a dynblock

2 weeks agoMerge pull request #16310 from rgacogne/ddist20-backport-16155
Remi Gacogne [Tue, 21 Oct 2025 12:34:44 +0000 (14:34 +0200)] 
Merge pull request #16310 from rgacogne/ddist20-backport-16155

dnsdist-2.0.x: Backport 16155 - Update the Rust library version when generating a tarball

2 weeks agoMerge pull request #16315 from rgacogne/ddist20-backport-16285
Remi Gacogne [Tue, 21 Oct 2025 12:27:50 +0000 (14:27 +0200)] 
Merge pull request #16315 from rgacogne/ddist20-backport-16285

dnsdist-2.0.x: Backport 16285 - Make inserting to the in-memory rings a bit faster

2 weeks agoMerge pull request #16316 from rgacogne/ddist20-backport-16256
Remi Gacogne [Tue, 21 Oct 2025 12:27:38 +0000 (14:27 +0200)] 
Merge pull request #16316 from rgacogne/ddist20-backport-16256

dnsdist-2.0.x: Backport 16256 - Allow selecting a specific version of Lua with meson

2 weeks agoMerge pull request #16317 from rgacogne/ddist20-backport-16254
Remi Gacogne [Tue, 21 Oct 2025 12:27:26 +0000 (14:27 +0200)] 
Merge pull request #16317 from rgacogne/ddist20-backport-16254

dnsdist-2.0.x: Backport 16254 - ComboAddress: Fix "unspecified address" test when the port is set

2 weeks agoMerge pull request #16318 from rgacogne/ddist20-backport-16244
Remi Gacogne [Tue, 21 Oct 2025 12:27:13 +0000 (14:27 +0200)] 
Merge pull request #16318 from rgacogne/ddist20-backport-16244

dnsdist-2.0.x: Backport #16244 - Set up the dns header for timeout response rules

2 weeks agoMerge pull request #16319 from rgacogne/ddist20-backport-16242
Remi Gacogne [Tue, 21 Oct 2025 12:26:59 +0000 (14:26 +0200)] 
Merge pull request #16319 from rgacogne/ddist20-backport-16242

dnsdist-2.0.x: Backport 16242 - Fix handling of large XSK frames

2 weeks agodnsdist: Fix query rules bypass after tagging from a dynblock 16309/head
Remi Gacogne [Fri, 17 Oct 2025 14:35:34 +0000 (16:35 +0200)] 
dnsdist: Fix query rules bypass after tagging from a dynblock

In 2.0.0 we introduced the ability to set a tag when a dynamic
block matches, making it possible to combine dynamic blocks with
existing rules. Unfortunately the implementation turned out to
bypass query rules after setting a tag, so the mechanism could
only be used with the remaining rules chains (cache hit, cache-miss,
cache inserted, self-answered and regular response rules).
This commit fixes that to ensure that we can use tags with query
rules as well.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit b2afaadbd8e3403a68a93fa82b7a25be9f89e385)

2 weeks agodnsdist: Error out in meson-sdist-script.sh when BUILDER_VERSION is unset 16310/head
Remi Gacogne [Mon, 22 Sep 2025 15:02:24 +0000 (17:02 +0200)] 
dnsdist: Error out in meson-sdist-script.sh when BUILDER_VERSION is unset

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit ed2ce8b3b7e103f8dc9953a55a1e814ceeb1bb64)

2 weeks agodnsdist: Add comment about the Rust library version being automatically updated
Remi Gacogne [Mon, 22 Sep 2025 15:01:28 +0000 (17:01 +0200)] 
dnsdist: Add comment about the Rust library version being automatically updated

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 97124012429f6d088575b350e7cf134c24538f3c)

2 weeks agodnsdist: Make inserting to the in-memory rings a bit faster 16315/head
Remi Gacogne [Fri, 17 Oct 2025 10:33:21 +0000 (12:33 +0200)] 
dnsdist: Make inserting to the in-memory rings a bit faster

This commit moves the allocation and copy of the DNS name before
taking the lock, reducing contention. In completely unrealistic
benchmarks this makes the insertion ~10% faster.
Ideally I would rather move the existing `DNSName` instead of allocating
a new one, as we are usually done with it by the point we insert
into the rings, but this involves a lot of changes so let's start
with this.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 868ec90eacc2fc10f923bbfc333cb5b802fc9fbb)

2 weeks agodnsdist: Allow selecting a specific version of Lua with meson 16316/head
Remi Gacogne [Mon, 13 Oct 2025 14:54:07 +0000 (16:54 +0200)] 
dnsdist: Allow selecting a specific version of Lua with meson

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit e85ba9b1a7e7d5fc38d295e1538173893c79eaaf)

2 weeks agotest-iputils_hh.cc: Appease clang-tidy 16317/head
Remi Gacogne [Mon, 13 Oct 2025 15:21:07 +0000 (17:21 +0200)] 
test-iputils_hh.cc: Appease clang-tidy

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 27ef73a521cf551bdc3b488df53727ec0c46057a)

2 weeks agoiputils: Make static addresses static in `ComboAddress::isUnspecified`
Remi Gacogne [Mon, 13 Oct 2025 14:44:15 +0000 (16:44 +0200)] 
iputils: Make static addresses static in `ComboAddress::isUnspecified`

Prevent having to instantiate them again and again, as suggested by
Otto.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit a4301807428dd4389d9bb43bffea171f5ca3c2ae)

2 weeks agoComboAddress: Fix "unspecified address" test when the port is set
Remi Gacogne [Mon, 13 Oct 2025 14:13:03 +0000 (16:13 +0200)] 
ComboAddress: Fix "unspecified address" test when the port is set

This fixes the QUIC issue reported on FreeBSD: the frontend
was not considered to be bound to an `ANY`/unspecified address
because the port was set, causing the address selection address
to fail.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 940d35a6237ba997bce1e1ef80ad836ad11da4ae)

2 weeks agodnsdist: Don't choke on invalid DNS payload when generating protobuf messages 16318/head
Remi Gacogne [Fri, 10 Oct 2025 14:40:25 +0000 (16:40 +0200)] 
dnsdist: Don't choke on invalid DNS payload when generating protobuf messages

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit ba78a38a7a2349ec73fa2a66b552eb2234b42007)

2 weeks agodnsdist: Properly zero-initialize the "fake" DNS header
Remi Gacogne [Fri, 10 Oct 2025 14:39:56 +0000 (16:39 +0200)] 
dnsdist: Properly zero-initialize the "fake" DNS header

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 153a1bf296f58c38cfd4fb96de29e2677ac42e04)

2 weeks agodnsdist: Set up the dns header for timeout response rules
Remi Gacogne [Fri, 10 Oct 2025 09:45:25 +0000 (11:45 +0200)] 
dnsdist: Set up the dns header for timeout response rules

Response actions expect that there is a DNS payload containing at
least a DNS header, as an incoming packet smaller than a DNS header
would have been discarded early in the processing path.
Unfortunately this is not true for timeout response rules, where we
no longer have the DNS payload from the query and obviously don't
have a response either. This commit restores a DNS header from the
information we have (query ID, flags) so that most actions can
proceed normally.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 0cc4805b11afde171880d8f8ee84716de0ce5335)

2 weeks agodnsdist: Fix handling of large XSK frames 16319/head
Remi Gacogne [Tue, 7 Oct 2025 11:34:49 +0000 (13:34 +0200)] 
dnsdist: Fix handling of large XSK frames

There was a bug in the way we were computing the remaining capacity
of a XSK frame, because we forgot to account for the network headers.
This caused some XSK responses to be discarded by the kernel (`tx_invalid_descs`)
because there was not enough space left in the frame (less than
`XDP_PACKET_HEADROOM`).

Thanks to `ednaq` for reporting this via ou YesWeHack program.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit e0eb6a798c02ccd0d613fff53b0e51560e0a9fba)

2 weeks agodnsdist: Make the round-robin LB policy internal counter atomic 16320/head
Remi Gacogne [Fri, 10 Oct 2025 08:18:40 +0000 (10:18 +0200)] 
dnsdist: Make the round-robin LB policy internal counter atomic

Otherwise TSAN is rightfully complaining that there is a data race
because several threads are updating at the same time. While the
impact of this counter being corrupted is almost zero, and there is
an actual overhead to making it atomic, I believe this is the only
correct way to ensure the expected behaviour of this policy.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 1ad48b108eadbe260c16443c1feaf393a2c1324b)

2 weeks agodnsdist: Properly handle exceptions when processing timeout rules 16322/head
Remi Gacogne [Thu, 9 Oct 2025 12:53:51 +0000 (14:53 +0200)] 
dnsdist: Properly handle exceptions when processing timeout rules

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 9a17d3411db3ee41c9b8f1ff998c8f4474b7e9a0)

2 weeks agodnsdist: Fix release builds by updating the locked Rust lib version 16324/head
Remi Gacogne [Thu, 25 Sep 2025 13:14:40 +0000 (15:14 +0200)] 
dnsdist: Fix release builds by updating the locked Rust lib version

Since we are now dynamically setting the version of our internal Rust library
when generating the release tarball, `cargo` needs to update the `Cargo.lock`
file to reflect the new version, which is not possible if we are passing `--locked`:
```
error: the lock file /pdns/dnsdist-2.1.0-alpha0.870.master.gc64b979bc/dnsdist-rust-lib/rust/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
```
This commit fixes that also updating the `Cargo.lock` file when generating the
release tarball so that `cargo` no longer needs to update the `Cargo.lock`.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit b99706f376d7ec0a21214e0ec31182f324082560)

2 weeks agodnsdist: Fix setting meta keys on response, pass them from question to response 16325/head
Remi Gacogne [Thu, 25 Sep 2025 10:01:52 +0000 (12:01 +0200)] 
dnsdist: Fix setting meta keys on response, pass them from question to response

This commit fixes setting Protocol Buffer meta keys on DNS response via Lua FFI:
the existing code was assuming it was possible to use the question methods on a
response object which is not true and would likely have ended in a crash at some
point.
It also propates meta keys set on a DNS question to the corresponding DNS response.
Before this commit the values were not passed along to the response which was quite
unexpected, especially for self-answered responses.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit e3381435870e89c8573efb4a44497a08b0807b24)

2 weeks agoupdate-rust-library-version: Not DNSdist-specific
Remi Gacogne [Mon, 22 Sep 2025 10:15:03 +0000 (12:15 +0200)] 
update-rust-library-version: Not DNSdist-specific

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 27ee747f17b7887e7514ec9b4f87cf7c7ecd8f77)

2 weeks agodnsdist: Update the Rust library version when generating a tarball
Remi Gacogne [Mon, 22 Sep 2025 09:43:11 +0000 (11:43 +0200)] 
dnsdist: Update the Rust library version when generating a tarball

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 1ec5492f189b694ed3b62db94aeee68f714a6244)

2 weeks agodnsdist: Document that the hash perturbation is NOT only used for chashed 16326/head
Remi Gacogne [Fri, 19 Sep 2025 12:15:09 +0000 (14:15 +0200)] 
dnsdist: Document that the hash perturbation is NOT only used for chashed

As suggested by Robert Edmonds (thank you!).

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit c23454eeb6d9233ca77115c72ba856e55fe64445)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
2 weeks agodnsdist: Initialize hash perturbation later, and only if needed
Remi Gacogne [Fri, 19 Sep 2025 12:14:23 +0000 (14:14 +0200)] 
dnsdist: Initialize hash perturbation later, and only if needed

As suggested by Robert Edmonds (many thanks!).

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 1362f8c0d846113f32d837a7be9af62c40c67a14)

2 weeks agodnsdist: Add the current hash perturbation setting to verbose logging
Remi Gacogne [Fri, 19 Sep 2025 12:13:32 +0000 (14:13 +0200)] 
dnsdist: Add the current hash perturbation setting to verbose logging

As suggested by Robert Edmonds (thanks!).

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit d7994e1c0458a88bce259c758d256cf6717cc79c)

2 weeks agodnsdist: Remove redundant assignment noticed by Otto 16327/head
Remi Gacogne [Thu, 25 Sep 2025 07:32:37 +0000 (09:32 +0200)] 
dnsdist: Remove redundant assignment noticed by Otto

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 6186a149e8c66640b45f53a6a905836855cbfbd4)

2 weeks agodnsdist: Appease clang-tidy
Remi Gacogne [Fri, 19 Sep 2025 09:37:37 +0000 (11:37 +0200)] 
dnsdist: Appease clang-tidy

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 332f2c37a7a7a8c07824ef93a0a796e39694bcfe)

2 weeks agodnsdist: Reduce complexity of `TCPConnectionToBackend::handleIO`
Remi Gacogne [Thu, 18 Sep 2025 13:12:04 +0000 (15:12 +0200)] 
dnsdist: Reduce complexity of `TCPConnectionToBackend::handleIO`

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit f253ae82322d2273a1c95f4423f6da373d5ff1d5)

2 weeks agodnsdist: Fix reentry issue in TCP downstream I/O on macOS/BSD
Remi Gacogne [Tue, 16 Sep 2025 15:24:50 +0000 (17:24 +0200)] 
dnsdist: Fix reentry issue in TCP downstream I/O on macOS/BSD

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 62af150ded89da4ae922e0ad6dc82af9868e7a5e)

2 weeks agodnsdist: Add a regression test for the incoming protocol selector 16328/head
Remi Gacogne [Fri, 4 Jul 2025 10:01:03 +0000 (12:01 +0200)] 
dnsdist: Add a regression test for the incoming protocol selector

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit c742379bac82700195f0bbd608b2e29a3e44ac95)

2 weeks agodnsdist: Add a selector to match the incoming protocol
Remi Gacogne [Thu, 3 Jul 2025 19:15:01 +0000 (21:15 +0200)] 
dnsdist: Add a selector to match the incoming protocol

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 363baee040886defdb57671fab3a336f83ae9099)

3 weeks agoMerge pull request #16276 from rgacogne/dnsdist-2.0.x-backport-16169
Remi Gacogne [Thu, 16 Oct 2025 08:48:35 +0000 (10:48 +0200)] 
Merge pull request #16276 from rgacogne/dnsdist-2.0.x-backport-16169

dnsdist-2.0.x: Backport 16169 - build-docker-images-tags: Grant enough permissions to sign images

3 weeks agoMerge pull request #16270 from rgacogne/dnsdist-2.0.x-backport-15267
Remi Gacogne [Thu, 16 Oct 2025 08:30:51 +0000 (10:30 +0200)] 
Merge pull request #16270 from rgacogne/dnsdist-2.0.x-backport-15267

dnsdist-2.0.x: Backport 15267: Fix the build-packages workflow

3 weeks agobuild-docker-images-tags: Grant enough permissions to sign images 16276/head
Remi Gacogne [Tue, 23 Sep 2025 14:15:13 +0000 (16:15 +0200)] 
build-docker-images-tags: Grant enough permissions to sign images

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
3 weeks agodnsdist-2.0.x: Fix the build-packages workflow 16270/head
romeroalx [Fri, 7 Mar 2025 07:00:19 +0000 (08:00 +0100)] 
dnsdist-2.0.x: Fix the build-packages workflow

(cherry picked from commit 0424014ebdcac41efc882559d6d5ea0d30bd444b)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
8 weeks agoMerge pull request #16102 from rgacogne/ddist20-backport-16065 dnsdist-2.0.1
Remi Gacogne [Wed, 10 Sep 2025 07:54:30 +0000 (09:54 +0200)] 
Merge pull request #16102 from rgacogne/ddist20-backport-16065

dnsdist-2.0.x: Backport 16065 - Test that the configuration is correctly reloaded in various cases

8 weeks agodnsdist: Test that the configuration is correctly reloaded 16102/head
Remi Gacogne [Mon, 1 Sep 2025 10:22:55 +0000 (12:22 +0200)] 
dnsdist: Test that the configuration is correctly reloaded

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit a139d6ddef76cabc203d0e9786110a6f3d3b3f2f)

8 weeks agodnsdist: Refresh configuration after `recv` which may have blocked for a long time
Remi Gacogne [Mon, 1 Sep 2025 10:22:06 +0000 (12:22 +0200)] 
dnsdist: Refresh configuration after `recv` which may have blocked for a long time

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 4f70dcdd60826448b4bcad5a44335de0c45dbeea)

8 weeks agoMerge pull request #16096 from rgacogne/ddist20-backport-16082
Remi Gacogne [Mon, 8 Sep 2025 14:53:30 +0000 (16:53 +0200)] 
Merge pull request #16096 from rgacogne/ddist20-backport-16082

dnsdist-2.0.x: Backport #16082 - Fix the IO reentry guard in outgoing DoH

8 weeks agodnsdist: Fix the IO reentry guard in outgoing DoH 16096/head
Remi Gacogne [Fri, 5 Sep 2025 07:35:44 +0000 (09:35 +0200)] 
dnsdist: Fix the IO reentry guard in outgoing DoH

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 81f0706bdf91c01ee26f8bb18315206af7a70b31)

8 weeks agoMerge pull request #16095 from rgacogne/ddist20-backport-16090
Remi Gacogne [Mon, 8 Sep 2025 13:47:18 +0000 (15:47 +0200)] 
Merge pull request #16095 from rgacogne/ddist20-backport-16090

dnsdist-2.0.x: Backport 16090 - Fix access to frontends while in client mode

8 weeks agodnsdist: Fix access to frontends while in client mode 16095/head
Remi Gacogne [Fri, 5 Sep 2025 14:38:49 +0000 (16:38 +0200)] 
dnsdist: Fix access to frontends while in client mode

Since 2.0 we return `nil` instead of an object containing a `NULL`
pointer when the requested object does not exist, to make it possible
to check the validity of the returned object from `Lua`. It makes
sense in all contexts except when we are in client mode, because
then accessing the object in the remaining parts of the configuration
will trigger an error. Our DNS over HTTPS documentation itself contains
such a Lua configuration snippet, which is now broken.
This commit reverts back to sending an object containg a `NULL`
pointer when accessing the frontends in the client mode case.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit e6b9a30bbe1e198702308d9904d067eb89b646f1)

8 weeks agoMerge pull request #16093 from rgacogne/ddist20-backport-15737
Remi Gacogne [Mon, 8 Sep 2025 09:50:39 +0000 (11:50 +0200)] 
Merge pull request #16093 from rgacogne/ddist20-backport-15737

dnsdist-2.0.x: Backport 15737 - dnsdist-resolver: Fix a bug when we get new IPs for a server

8 weeks agodnsdist-resolver: Fix a bug when we get new IPs for a server 16093/head
Remi Gacogne [Fri, 27 Jun 2025 14:09:18 +0000 (16:09 +0200)] 
dnsdist-resolver: Fix a bug when we get new IPs for a server

The `dnsdist-resolver` script regularly checks the IPs corresponding
to a backend `hostname`, and updates our backend accordingly:
- if an IP we previously received vanishes, it removes the backend
  corresponding to that IP
- if a new IP shows up, it adds a new backend

The existing code tries to avoid some work by keeping track of the
number of IPs associated to a given server, skipping the comparisons
of recently received IPs to existing ones if the number did not change.
This unfortunately does not work well if we get the same number of IPs
but with different IPs in the set.
This caused some backends to never get removed and stay along as ghosts,
as well as some new IPs to never be picked up.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit e306ec7a085282893b93214a75ba3aac4d9435b4)

2 months agoMerge pull request #16080 from rgacogne/ddist20-backport-16015
Remi Gacogne [Fri, 5 Sep 2025 07:55:29 +0000 (09:55 +0200)] 
Merge pull request #16080 from rgacogne/ddist20-backport-16015

dnsdist-2.0.x: Backport 16015 - Don't call `nghttp2_session_send` from a callback

2 months agoMerge pull request #16081 from rgacogne/ddist20-backport-16064
Remi Gacogne [Fri, 5 Sep 2025 07:55:21 +0000 (09:55 +0200)] 
Merge pull request #16081 from rgacogne/ddist20-backport-16064

dnsdist-2.0.x: Backport 16064 - Properly handle truncation for UDP responses sent via `sendmmsg`

2 months agodnsdist: Properly handle truncation for UDP responses sent via `sendmmsg` 16081/head
Remi Gacogne [Mon, 1 Sep 2025 12:00:09 +0000 (14:00 +0200)] 
dnsdist: Properly handle truncation for UDP responses sent via `sendmmsg`

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit bf06a3d6b2f517b0cf365e218c752548029ea4a6)

2 months agodnsdist: Fix a typo is an exception message spotted by Miod 16080/head
Remi Gacogne [Fri, 22 Aug 2025 12:38:35 +0000 (14:38 +0200)] 
dnsdist: Fix a typo is an exception message spotted by Miod

Co-authored-by: Miod Vallat <miod.vallat@powerdns.com>
Signed-off-by: Remi Gacogne <github@coredump.fr>
(cherry picked from commit 28238ca3fb9fab245b90d912a30355567aa7266d)

2 months agodnsdist: Apply Miod's suggestion
Remi Gacogne [Fri, 22 Aug 2025 12:38:03 +0000 (14:38 +0200)] 
dnsdist: Apply Miod's suggestion

Co-authored-by: Miod Vallat <miod.vallat@powerdns.com>
Signed-off-by: Remi Gacogne <github@coredump.fr>
(cherry picked from commit 0cf2668a8c625f72944f682010befbe3089b9dd0)

2 months agodnsdist: Fix clang-tidy warnings
Remi Gacogne [Fri, 22 Aug 2025 12:22:29 +0000 (14:22 +0200)] 
dnsdist: Fix clang-tidy warnings

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit baad31c2b9db48acd1874db743a1764beaa05931)

2 months agodnsdist: Don't call `nghttp2_session_send` from a callback
Remi Gacogne [Fri, 22 Aug 2025 08:33:14 +0000 (10:33 +0200)] 
dnsdist: Don't call `nghttp2_session_send` from a callback

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit a917d158c3f8994e84b38cacbaec5668b1745460)

2 months agodnsdist: Fix a memory access violation in the nghttp2 unit tests
Remi Gacogne [Fri, 22 Aug 2025 07:57:57 +0000 (09:57 +0200)] 
dnsdist: Fix a memory access violation in the nghttp2 unit tests

Calling `nghttp2_session_send` from a callback does not work well
when ``nghttp2_session_send`` ends up closing the current stream,
triggering a use-after-free.
It's not clear from the API documentation, but it is mentioned in
the programmers' guide's remarks:

> Do not call `nghttp2_session_send()`, `nghttp2_session_mem_send2()`,
`nghttp2_session_recv()` or `nghttp2_session_mem_recv2()` from the
nghttp2 callback functions directly or indirectly. It will lead to the
crash. You can submit requests or frames in the callbacks then call
these functions outside the callbacks.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 346d37abe3beedcec8c856ea4421311de4df1d24)

2 months agoMerge pull request #16053 from rgacogne/ddist20-backport-15874
Remi Gacogne [Fri, 29 Aug 2025 11:29:32 +0000 (13:29 +0200)] 
Merge pull request #16053 from rgacogne/ddist20-backport-15874

dnsdist-2.0.x: Backport 15874 - Only check the freshness of the configuration when needed

2 months agoMerge pull request #16052 from rgacogne/ddist20-backport-16043
Remi Gacogne [Thu, 28 Aug 2025 12:10:18 +0000 (14:10 +0200)] 
Merge pull request #16052 from rgacogne/ddist20-backport-16043

dnsdist-2.0.x: Backport 16043 - Allow building wth gcc8, which needs -lstdc++fs as link argument

2 months agoMerge pull request #16049 from rgacogne/ddist20-backport-16042
Remi Gacogne [Thu, 28 Aug 2025 12:10:01 +0000 (14:10 +0200)] 
Merge pull request #16049 from rgacogne/ddist20-backport-16042

dnsdist-2.0.x: Backport 16042 - Don't increment in a potential macro argument

2 months agoMerge pull request #16048 from rgacogne/ddist20-backport-16038
Remi Gacogne [Thu, 28 Aug 2025 09:38:49 +0000 (11:38 +0200)] 
Merge pull request #16048 from rgacogne/ddist20-backport-16038

dnsdist-2.0.x: Backport 16038 - Add missing generated files to the dist tarball

2 months agodnsdist: Expose `refreshRuntimeConfiguration` to Lua 16053/head
Remi Gacogne [Mon, 25 Aug 2025 13:22:39 +0000 (15:22 +0200)] 
dnsdist: Expose `refreshRuntimeConfiguration` to Lua

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 6ac7c5514aa28d63e0d46e06c4c37df4213585d4)

2 months agodnsdist: Also refresh the configuration when `recvmmsg` is used
Remi Gacogne [Fri, 22 Aug 2025 13:20:04 +0000 (15:20 +0200)] 
dnsdist: Also refresh the configuration when `recvmmsg` is used

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 8539d039f68d7e7c256d2575191a364664ae882b)

2 months agodnsdist: Better config refresh logic in the TCP/DoH threads
Remi Gacogne [Tue, 29 Jul 2025 08:34:48 +0000 (10:34 +0200)] 
dnsdist: Better config refresh logic in the TCP/DoH threads

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 51d2c34c0e209120a4692697a56e3a8bcaeb9af0)

2 months agodnsdist: Ensure the runtime configuration is updated in the SNMP thread
Remi Gacogne [Fri, 25 Jul 2025 14:28:56 +0000 (16:28 +0200)] 
dnsdist: Ensure the runtime configuration is updated in the SNMP thread

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit a7da19df49ebd0745449eb206ca035a18500d251)

2 months agodnsdist: Explicitly update the configuration thread-local copy
Remi Gacogne [Thu, 17 Jul 2025 15:10:04 +0000 (17:10 +0200)] 
dnsdist: Explicitly update the configuration thread-local copy

This commits ensures that all DNSdist threads are regularly checking
if there is a new version of the runtime-modifiable configuration and
update their local copy if necessary. Regular accesses to the copy
are now fully read-only, meaning they do not invalidate the current copy.
It prevents the case where a function is invalidating the copy that the
caller is holding, and makes accessing the configuration cheaper.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit c08ba9f1f2fe743c3e05313b2c329446e2e2d1b1)

2 months agodnsdist: allow building wth gcc8, which needs -lstdc++fs as link argument 16052/head
Otto Moerbeek [Thu, 28 Aug 2025 08:15:16 +0000 (10:15 +0200)] 
dnsdist: allow building wth gcc8, which needs -lstdc++fs as link argument

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
(cherry picked from commit d74d63d0963bdb2790a95cfc6ef1564c1f176745)

2 months agoMerge pull request #16045 from rgacogne/ddist20-backport-16007
Remi Gacogne [Thu, 28 Aug 2025 09:11:31 +0000 (11:11 +0200)] 
Merge pull request #16045 from rgacogne/ddist20-backport-16007

dnsdist-2.0.x: Backport 16007 - Add mitigations for the HTTP/2 MadeYouReset attack

2 months agodnsdist: don't increment in a potential macro argument 16049/head
Otto Moerbeek [Thu, 28 Aug 2025 07:53:53 +0000 (09:53 +0200)] 
dnsdist: don't increment in a potential macro argument

Fixes g++ 8: ../dnsdist-crypto.cc:291:16: warning: operation on 'count' may be undefined [-Wsequence-point]

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
(cherry picked from commit 6a269e10520ffd5431830e8c1ee87e464d458663)

2 months agodnsdist: Add missing generated files to the dist tarball 16048/head
Remi Gacogne [Tue, 26 Aug 2025 11:58:54 +0000 (13:58 +0200)] 
dnsdist: Add missing generated files to the dist tarball

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 847331c4fe8b55a704889e0861f4f95b5e9e163e)

2 months agodnsdist: Fix invalid log formatters spotted by Otto 16045/head
Remi Gacogne [Mon, 25 Aug 2025 11:08:41 +0000 (13:08 +0200)] 
dnsdist: Fix invalid log formatters spotted by Otto

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 36aeac05daeffcbc41443b47660982f65d73b7da)

2 months agodnsdist: Apply Miod and clang-tidy's suggestions
Remi Gacogne [Thu, 21 Aug 2025 13:43:01 +0000 (15:43 +0200)] 
dnsdist: Apply Miod and clang-tidy's suggestions

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit f2bee342a4b53cd4ea4896e280ccafeb9f24db34)

2 months agodnsdist: Stop reading on incoming DoH sockets if we are done
Remi Gacogne [Mon, 28 Jul 2025 14:33:46 +0000 (16:33 +0200)] 
dnsdist: Stop reading on incoming DoH sockets if we are done

If the underlying library doesn't want to read, we have nothing
to send at the moment, but we are still waiting for responses,
there is no need to keep polling the socket.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit e0a5a6dc4ab9557442ddbba56d03f6e4fb132bf2)

2 months agodnsdist: Fix the accounting of "killed" streams
Remi Gacogne [Mon, 28 Jul 2025 14:31:36 +0000 (16:31 +0200)] 
dnsdist: Fix the accounting of "killed" streams

The way the nghttp2 library works means that we can get notified
that a stream has been closed while we are still in the function
sending the actual response. This is not a "killed" stream, but
just a regular closure.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit b81ed956d2f0b6bc538b34ee7e7ad304be233e7a)

2 months agodnsdist: Define `dnsdist::doh::MAX_INCOMING_CONCURRENT_STREAMS`
Remi Gacogne [Fri, 20 Jun 2025 11:44:33 +0000 (13:44 +0200)] 
dnsdist: Define `dnsdist::doh::MAX_INCOMING_CONCURRENT_STREAMS`

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 866c8f3fff753d3b2a03c1da50e8d53056880a46)

2 months agodnsdist: Tentative h2o fix for MadeYouReset
Remi Gacogne [Thu, 19 Jun 2025 10:39:11 +0000 (12:39 +0200)] 
dnsdist: Tentative h2o fix for MadeYouReset

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 2406bc461dbac384b07ed7dbb73a87def6354bd6)

2 months agodnsdist: Enforce concurrent streams count for pending queries
Remi Gacogne [Thu, 19 Jun 2025 09:18:27 +0000 (11:18 +0200)] 
dnsdist: Enforce concurrent streams count for pending queries

The gist of the `MadeYouRest` attack is that streams can be reset
by the client, and thus no longer count towards the maximum number
of a streams as far as the library is concerned, while the server
is still processing the query and doing actual work.
This pull request introduces a counter for "killed but still being
processed streams" to prevent it.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 0214032c5f09fcfb440e5c5120f1491cb4f0fda4)

2 months agoMerge pull request #16032 from rgacogne/ddist20-backport-15881
Remi Gacogne [Mon, 25 Aug 2025 11:07:38 +0000 (13:07 +0200)] 
Merge pull request #16032 from rgacogne/ddist20-backport-15881

dnsdist-2.0.x: Backport 15881 - Support mnemonics for the Opcode selector

2 months agoMerge pull request #16031 from rgacogne/ddist20-backport-15817
Remi Gacogne [Mon, 25 Aug 2025 09:44:39 +0000 (11:44 +0200)] 
Merge pull request #16031 from rgacogne/ddist20-backport-15817

dnsdist-2.0.x: Backport 15817: switch Docker images to Debian Trixie

2 months agoMerge pull request #16030 from rgacogne/ddist20-backport-15915
Remi Gacogne [Mon, 25 Aug 2025 09:44:29 +0000 (11:44 +0200)] 
Merge pull request #16030 from rgacogne/ddist20-backport-15915

dnsdist-2.0.x: Backport 15915: Properly set up env vars with meson

2 months agodns: Get rid of the ugly special case for OpCode 3 16032/head
Remi Gacogne [Thu, 24 Jul 2025 09:11:24 +0000 (11:11 +0200)] 
dns: Get rid of the ugly special case for OpCode 3

As suggested by Miod.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit b6898b5f3787e2528225fd5e22927f2e5ba3cc2b)

2 months agodnsdist: Support mnemonics for the Opcode selector
Remi Gacogne [Mon, 21 Jul 2025 09:56:47 +0000 (11:56 +0200)] 
dnsdist: Support mnemonics for the Opcode selector

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 1a37caf4bcef0ad8362ce5b2bf8f01e90c81986d)

2 months agoMerge pull request #16029 from rgacogne/ddist20-backport-15959
Remi Gacogne [Mon, 25 Aug 2025 09:18:59 +0000 (11:18 +0200)] 
Merge pull request #16029 from rgacogne/ddist20-backport-15959

dnsdist-2.0.x: Backport 15959: dnsdist --version: report yaml support

2 months agoswitch Docker images to Debian Trixie 16031/head
Peter van Dijk [Thu, 10 Jul 2025 12:05:41 +0000 (14:05 +0200)] 
switch Docker images to Debian Trixie

(cherry picked from commit 4a92c4bbda9c5a0d0b9b30865dff71d70226cfcf)

2 months agorec and dnsdist: properly set up env vars 16030/head
Otto Moerbeek [Thu, 24 Jul 2025 13:41:50 +0000 (15:41 +0200)] 
rec and dnsdist: properly set up env vars

env.append() appends to an existing value

Should fix the error in #15896, but the reported location of cargo
still might be wrong.

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
(cherry picked from commit 6d3c2334aa84258eaee409eb7e545eb67121a4a5)

2 months agodnsdist --version: report yaml support 16029/head
Peter van Dijk [Mon, 4 Aug 2025 11:56:05 +0000 (13:56 +0200)] 
dnsdist --version: report yaml support

(cherry picked from commit 8ac38640efa2c90f1db59fddcd32cdb6c29d41db)

2 months agoMerge pull request #16020 from rgacogne/ddist20-backport-15931
Remi Gacogne [Mon, 25 Aug 2025 07:35:29 +0000 (09:35 +0200)] 
Merge pull request #16020 from rgacogne/ddist20-backport-15931

dnsdist-2.0.x: Backport 15931- Speed up response content matching

2 months agoMerge pull request #16019 from rgacogne/ddist20-backport-15935
Remi Gacogne [Fri, 22 Aug 2025 13:46:57 +0000 (15:46 +0200)] 
Merge pull request #16019 from rgacogne/ddist20-backport-15935

dnsdist-2.0.x: Backport 15935 - Clean up incoming TCP connections counters once per minute

2 months agoMerge pull request #16018 from rgacogne/ddist20-backport-15904
Remi Gacogne [Fri, 22 Aug 2025 13:26:39 +0000 (15:26 +0200)] 
Merge pull request #16018 from rgacogne/ddist20-backport-15904

dnsdist-2.0.x: Backport 15904 - Fix systemd template unit and restricted network families when building with meson

2 months agoMerge pull request #16017 from rgacogne/ddist20-backport-15902
Remi Gacogne [Fri, 22 Aug 2025 13:16:01 +0000 (15:16 +0200)] 
Merge pull request #16017 from rgacogne/ddist20-backport-15902

dnsdist-2.0.x: Backport 15902 - Fix QType rate dynamic block with YAML

2 months agoRefactor `DNSName::matches` around `pdns_ilexicographical_compare_three_way` 16020/head
Remi Gacogne [Thu, 21 Aug 2025 14:40:29 +0000 (16:40 +0200)] 
Refactor `DNSName::matches` around `pdns_ilexicographical_compare_three_way`

And rename it to hopefully prevent any confusion regarding when it can be used.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit f78521d7f73d1f176602e33d03fae6e40fa86602)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>