]> git.ipfire.org Git - thirdparty/pdns.git/log
thirdparty/pdns.git
4 weeks agodnsdist: Keep processing XSK packets on exception
Remi Gacogne [Mon, 18 May 2026 11:04:42 +0000 (13:04 +0200)] 
dnsdist: Keep processing XSK packets on exception

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Prevent UB when OT object it not found on the stack
Remi Gacogne [Mon, 18 May 2026 11:04:04 +0000 (13:04 +0200)] 
dnsdist: Prevent UB when OT object it not found on the stack

This should not happen, but we know how it goes..

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Handle small MAC addresses
Remi Gacogne [Mon, 18 May 2026 11:03:42 +0000 (13:03 +0200)] 
dnsdist: Handle small MAC addresses

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Move the NetworkListener's data earlier to prevent a race
Remi Gacogne [Mon, 18 May 2026 11:03:09 +0000 (13:03 +0200)] 
dnsdist: Move the NetworkListener's data earlier to prevent a race

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Increase the correct bucket for high-latency responses
Remi Gacogne [Mon, 18 May 2026 11:02:14 +0000 (13:02 +0200)] 
dnsdist: Increase the correct bucket for high-latency responses

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Fix duplicate entry for setTCPConnectionsOverloadThreshold
Remi Gacogne [Mon, 18 May 2026 11:01:49 +0000 (13:01 +0200)] 
dnsdist: Fix duplicate entry for setTCPConnectionsOverloadThreshold

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Correct error message in setHealthCheckResponseValidator
Remi Gacogne [Mon, 18 May 2026 11:01:29 +0000 (13:01 +0200)] 
dnsdist: Correct error message in setHealthCheckResponseValidator

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agolibssl: Properly deal with an empty error stack in `libssl_get_error_string` 17398/head
Remi Gacogne [Mon, 18 May 2026 10:58:14 +0000 (12:58 +0200)] 
libssl: Properly deal with an empty error stack in `libssl_get_error_string`

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agolibssl: Fix the position of OCSP files on errors
Remi Gacogne [Mon, 18 May 2026 10:57:25 +0000 (12:57 +0200)] 
libssl: Fix the position of OCSP files on errors

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Check the DoQ query size against the received size 17397/head
Remi Gacogne [Mon, 18 May 2026 10:53:48 +0000 (12:53 +0200)] 
dnsdist: Check the DoQ query size against the received size

The existing code was doing the check against the size
allocated, not the one actually used.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agosnmp-agent: Fix a memory leak 17396/head
Remi Gacogne [Mon, 18 May 2026 10:50:21 +0000 (12:50 +0200)] 
snmp-agent: Fix a memory leak

We need to call netsnmp_large_fd_set_cleanup to release the
memory allocated by netsnmp_large_fd_set_init.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Use the correct timestamp, not now, for ISO-8601 format 17395/head
Remi Gacogne [Mon, 18 May 2026 10:45:52 +0000 (12:45 +0200)] 
dnsdist: Use the correct timestamp, not now, for ISO-8601 format

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Proper error handling in setEDNSOption 17394/head
Remi Gacogne [Mon, 18 May 2026 10:42:33 +0000 (12:42 +0200)] 
dnsdist: Proper error handling in setEDNSOption

We need to return false when it was not possible to set the option,
and to properly set the value indicating that we added an EDNS OPT
RR if needed.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Handle empty EDNS options in slowRewriteEDNSOptionInQueryWithRecords
Remi Gacogne [Mon, 18 May 2026 10:41:39 +0000 (12:41 +0200)] 
dnsdist: Handle empty EDNS options in slowRewriteEDNSOptionInQueryWithRecords

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Ignore valid backend weight coming from YAML
Remi Gacogne [Mon, 18 May 2026 10:39:48 +0000 (12:39 +0200)] 
dnsdist: Ignore valid backend weight coming from YAML

We do handle that in the Lua configuration already.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agotcpiohandler: Don't throw exceptions over the C/C++ boundary
Remi Gacogne [Mon, 18 May 2026 10:37:30 +0000 (12:37 +0200)] 
tcpiohandler: Don't throw exceptions over the C/C++ boundary

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Better handling of exceptions in outgoing DoH
Remi Gacogne [Mon, 18 May 2026 10:36:04 +0000 (12:36 +0200)] 
dnsdist: Better handling of exceptions in outgoing DoH

We cannot throw exceptions over the C++/C boundary.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Handle exceptions when dealing with asynchronous objects
Remi Gacogne [Mon, 18 May 2026 10:34:21 +0000 (12:34 +0200)] 
dnsdist: Handle exceptions when dealing with asynchronous objects

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Fix TeeAction metrics on error/short datagrams 17391/head
Remi Gacogne [Mon, 18 May 2026 10:32:10 +0000 (12:32 +0200)] 
dnsdist: Fix TeeAction metrics on error/short datagrams

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Fix a bug not always displaying the first eBPF entry of a map
Remi Gacogne [Mon, 18 May 2026 10:30:00 +0000 (12:30 +0200)] 
dnsdist: Fix a bug not always displaying the first eBPF entry of a map

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Don't count BPF range entries twice
Remi Gacogne [Mon, 18 May 2026 10:18:49 +0000 (12:18 +0200)] 
dnsdist: Don't count BPF range entries twice

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Fix invalid BPF map size check
Remi Gacogne [Mon, 18 May 2026 10:17:23 +0000 (12:17 +0200)] 
dnsdist: Fix invalid BPF map size check

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agoMerge pull request #17389 from miodvallat/minus148
Miod Vallat [Mon, 18 May 2026 09:08:22 +0000 (11:08 +0200)] 
Merge pull request #17389 from miodvallat/minus148

auth: stricter string-to-int conversions

4 weeks agoMerge pull request #17388 from miodvallat/wheresmypassword
Miod Vallat [Mon, 18 May 2026 08:53:56 +0000 (10:53 +0200)] 
Merge pull request #17388 from miodvallat/wheresmypassword

auth: webserver documentation tweaks

4 weeks agodnsdist: More clang-tidy fixes
Remi Gacogne [Mon, 18 May 2026 08:47:32 +0000 (10:47 +0200)] 
dnsdist: More clang-tidy fixes

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: More clang-tidy fixes
Remi Gacogne [Sun, 17 May 2026 09:47:16 +0000 (11:47 +0200)] 
dnsdist: More clang-tidy fixes

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agoReplace a bunch of std::stoi with pdns::checked_stoi. 17389/head
Miod Vallat [Mon, 18 May 2026 07:31:47 +0000 (09:31 +0200)] 
Replace a bunch of std::stoi with pdns::checked_stoi.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoCorrectly reject a negative number of entries for search.
Miod Vallat [Mon, 18 May 2026 07:31:23 +0000 (09:31 +0200)] 
Correctly reject a negative number of entries for search.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoSort webserver options. 17388/head
Miod Vallat [Mon, 18 May 2026 06:42:10 +0000 (08:42 +0200)] 
Sort webserver options.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoAdvise configuring webserver-password more strongly.
Miod Vallat [Mon, 18 May 2026 06:38:44 +0000 (08:38 +0200)] 
Advise configuring webserver-password more strongly.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoMerge pull request #17381 from rgacogne/ddist-fix-set-health-check-params
Remi Gacogne [Sun, 17 May 2026 09:19:54 +0000 (11:19 +0200)] 
Merge pull request #17381 from rgacogne/ddist-fix-set-health-check-params

dnsdist: Fix DownstreamState::setHealthCheckParams

4 weeks agoMerge pull request #17382 from rgacogne/ddist-cdb-race
Remi Gacogne [Fri, 15 May 2026 20:01:38 +0000 (22:01 +0200)] 
Merge pull request #17382 from rgacogne/ddist-cdb-race

dnsdist: Fix a data race on concurrent CDB KVS lookups

4 weeks agoMerge pull request #17383 from rgacogne/ddist-xsk-fixes
Remi Gacogne [Fri, 15 May 2026 20:01:16 +0000 (22:01 +0200)] 
Merge pull request #17383 from rgacogne/ddist-xsk-fixes

dnsdist: Fix a few issues in our AF_XDP/XSK code

5 weeks agodnsdist: Remove empty line
Remi Gacogne [Fri, 15 May 2026 15:17:08 +0000 (17:17 +0200)] 
dnsdist: Remove empty line

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17384 from rgacogne/edns-cookie-validity-logic
Remi Gacogne [Fri, 15 May 2026 15:15:36 +0000 (17:15 +0200)] 
Merge pull request #17384 from rgacogne/edns-cookie-validity-logic

ednscookies: Fix timestamp validity check

5 weeks agodnsdist: Gracefully handle no TLS session tickets allowed 17375/head
Remi Gacogne [Fri, 15 May 2026 15:02:29 +0000 (17:02 +0200)] 
dnsdist: Gracefully handle no TLS session tickets allowed

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17239 from GrapheneOS/improved-backup-selector
Miod Vallat [Fri, 15 May 2026 15:00:59 +0000 (17:00 +0200)] 
Merge pull request #17239 from GrapheneOS/improved-backup-selector

auth: only apply backupSelector to the first non-empty group

5 weeks agodnsdist: Fix formatting 17383/head
Remi Gacogne [Fri, 15 May 2026 14:57:04 +0000 (16:57 +0200)] 
dnsdist: Fix formatting

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix a bug caught by clang-tidy 17381/head
Remi Gacogne [Fri, 15 May 2026 14:54:39 +0000 (16:54 +0200)] 
dnsdist: Fix a bug caught by clang-tidy

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Add a unit test for "keep live connections around"
Remi Gacogne [Fri, 15 May 2026 14:52:29 +0000 (16:52 +0200)] 
dnsdist: Add a unit test for "keep live connections around"

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Make clang-tidy happy
Remi Gacogne [Fri, 15 May 2026 14:52:13 +0000 (16:52 +0200)] 
dnsdist: Make clang-tidy happy

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Keep concurrent connection entries for live connections
Remi Gacogne [Fri, 15 May 2026 14:51:11 +0000 (16:51 +0200)] 
dnsdist: Keep concurrent connection entries for live connections

Otherwise clients that manage to keep their connections around for
a long time can bypass the limit.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17380 from rgacogne/ddist-ecs-wrap-around
Remi Gacogne [Fri, 15 May 2026 14:34:34 +0000 (16:34 +0200)] 
Merge pull request #17380 from rgacogne/ddist-ecs-wrap-around

dnsdist: Fix OPT rdlen computation when adding ECS

5 weeks agoednscookies: Fix timestamp validity check 17384/head
Remi Gacogne [Fri, 15 May 2026 14:20:18 +0000 (16:20 +0200)] 
ednscookies: Fix timestamp validity check

I _think_ the check was wrong, but please double-check my logic.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Appease clang-tidy (again)
Remi Gacogne [Fri, 15 May 2026 14:05:36 +0000 (16:05 +0200)] 
dnsdist: Appease clang-tidy (again)

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17378 from rgacogne/ddist-smt-top-counters
Remi Gacogne [Fri, 15 May 2026 14:03:34 +0000 (16:03 +0200)] 
Merge pull request #17378 from rgacogne/ddist-smt-top-counters

dnsdist: Fix the dynamic block top suffixes counters computation

5 weeks agodnsdist: Fix checksum computation when data len is not a multiple of 4
Remi Gacogne [Fri, 15 May 2026 14:00:04 +0000 (16:00 +0200)] 
dnsdist: Fix checksum computation when data len is not a multiple of 4

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Properly handle interrupted writes in the XSK worker
Remi Gacogne [Fri, 15 May 2026 13:59:40 +0000 (15:59 +0200)] 
dnsdist: Properly handle interrupted writes in the XSK worker

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Prevent duplicated responses for "too large" XSK responses
Remi Gacogne [Fri, 15 May 2026 13:59:15 +0000 (15:59 +0200)] 
dnsdist: Prevent duplicated responses for "too large" XSK responses

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix a data race on concurrent CDB KVS lookups 17382/head
Remi Gacogne [Fri, 15 May 2026 13:49:10 +0000 (15:49 +0200)] 
dnsdist: Fix a data race on concurrent CDB KVS lookups

Contrary to the assumption that was made by the existing author (me!),
`tinycdb` structures are not safe to use concurrently from more than
one thread, even for reading, as they hold data related to the current
search (current position, mostly).
This will have a performance impact for heavy users of the CDB KVS store,
so perhaps a follow-up PR might be needed to have a per-thread CDB instance
instead.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix DownstreamState::setHealthCheckParams
Remi Gacogne [Fri, 15 May 2026 13:39:55 +0000 (15:39 +0200)] 
dnsdist: Fix DownstreamState::setHealthCheckParams

We cannot rely on the value of the variable being different from 0
since we reuse it for all options.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17377 from rgacogne/ddist-dq-getproxyprotocolvalues
Remi Gacogne [Fri, 15 May 2026 13:32:55 +0000 (15:32 +0200)] 
Merge pull request #17377 from rgacogne/ddist-dq-getproxyprotocolvalues

dnsdist: Fix useless allocation in DNSQuestion:getProxyProtocolValues

5 weeks agoMerge pull request #17379 from rgacogne/ddist-packet-parser-reserve
Remi Gacogne [Fri, 15 May 2026 13:32:35 +0000 (15:32 +0200)] 
Merge pull request #17379 from rgacogne/ddist-packet-parser-reserve

dnsdist: Compute a less inaccurate number of DNS records to pass to `reserve()`

5 weeks agodnsdist: Fix OPT rdlen computation when adding ECS 17380/head
Remi Gacogne [Fri, 15 May 2026 13:27:49 +0000 (15:27 +0200)] 
dnsdist: Fix OPT rdlen computation when adding ECS

If an incoming query has a very large EDNS OPT rdata length, but
not the corresponding bytes, the existing code could have wrapped
around to a small value after adding ECS. We would then send an invalid
OPT record with some trailing bytes. The query would have been discarded
by the backend but that's not very nice, let's drop it early AND make
sure we don't wrap around.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Appease clang-tidy
Remi Gacogne [Fri, 15 May 2026 13:13:44 +0000 (15:13 +0200)] 
dnsdist: Appease clang-tidy

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Appease clang-tidy
Remi Gacogne [Fri, 15 May 2026 13:05:10 +0000 (15:05 +0200)] 
dnsdist: Appease clang-tidy

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Compute a less inaccurate number of DNS records to pass to `reserve()` 17379/head
Remi Gacogne [Fri, 15 May 2026 12:43:54 +0000 (14:43 +0200)] 
dnsdist: Compute a less inaccurate number of DNS records to pass to `reserve()`

Same fix than in 0d45ff9b8ddc556074a8149cc4791105e3ed0400

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix the dynamic block top suffixes counters computation 17378/head
Remi Gacogne [Fri, 15 May 2026 12:35:13 +0000 (14:35 +0200)] 
dnsdist: Fix the dynamic block top suffixes counters computation

The counter was assigned in the loop instead of being added to.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix useless allocation in DNSQuestion:getProxyProtocolValues 17377/head
Remi Gacogne [Fri, 15 May 2026 12:27:50 +0000 (14:27 +0200)] 
dnsdist: Fix useless allocation in DNSQuestion:getProxyProtocolValues

We used to resize the vector instead of reserving memory, which is silly.
It turns out that LuaWrapper cleaned up after us, but this was not nice.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agocredentials: Try harder to zero out existing data
Remi Gacogne [Fri, 15 May 2026 12:23:02 +0000 (14:23 +0200)] 
credentials: Try harder to zero out existing data

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix outgoing TLS session cache cleanup
Remi Gacogne [Fri, 15 May 2026 12:20:35 +0000 (14:20 +0200)] 
dnsdist: Fix outgoing TLS session cache cleanup

The logic to compute the cut off time was wrong, leading to
outgoint TLS resumption tickets to not be properly cleaned up.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17372 from rgacogne/ddist-fix-xsk-yaml
Remi Gacogne [Fri, 15 May 2026 12:05:28 +0000 (14:05 +0200)] 
Merge pull request #17372 from rgacogne/ddist-fix-xsk-yaml

dnsdist: Fix XSK configuration via YAML

5 weeks agodnsdist: Fix XSK configuration via YAML 17372/head
Remi Gacogne [Fri, 15 May 2026 11:24:02 +0000 (13:24 +0200)] 
dnsdist: Fix XSK configuration via YAML

The XSK map was not properly allocated, triggering a crash
when trying to load a YAML configuration file with XSK support.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17366 from romeroalx/fix-verify-packages-packagin-262
Alexis Romero [Fri, 15 May 2026 11:23:24 +0000 (13:23 +0200)] 
Merge pull request #17366 from romeroalx/fix-verify-packages-packagin-262

requirements.txt: update version of pinned packages

5 weeks agoCorrectly emit APL records with IPv4 addresses ending in .0 17367/head
Miod Vallat [Fri, 15 May 2026 08:00:01 +0000 (10:00 +0200)] 
Correctly emit APL records with IPv4 addresses ending in .0

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
5 weeks agoMerge pull request #17369 from rgacogne/ddist-fix-tracing-no-backend
Remi Gacogne [Fri, 15 May 2026 09:45:53 +0000 (11:45 +0200)] 
Merge pull request #17369 from rgacogne/ddist-fix-tracing-no-backend

dnsdist: Fix a crash when OpenTelemetry tracing is enabled

5 weeks agoclang-tidy-diff: Fix formatting 17371/head
Remi Gacogne [Fri, 15 May 2026 09:44:18 +0000 (11:44 +0200)] 
clang-tidy-diff: Fix formatting

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoclang-tidy: Normalize database compilation path
Remi Gacogne [Fri, 15 May 2026 09:32:00 +0000 (11:32 +0200)] 
clang-tidy: Normalize database compilation path

This is needed when building with meson because the paths may contain
`..` components.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoclang-tidy-diff: Error when at least one `clang-tidy` command failed
Remi Gacogne [Tue, 12 May 2026 10:01:29 +0000 (12:01 +0200)] 
clang-tidy-diff: Error when at least one `clang-tidy` command failed

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Use NUL-terminated instead of NULL-terminated
Remi Gacogne [Fri, 15 May 2026 09:23:44 +0000 (11:23 +0200)] 
dnsdist: Use NUL-terminated instead of NULL-terminated

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Document the "tricky" Lua FFI functions a bit better
Remi Gacogne [Tue, 21 Apr 2026 08:20:44 +0000 (10:20 +0200)] 
dnsdist: Document the "tricky" Lua FFI functions a bit better

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Harden the Lua FFI interface against misuse
Remi Gacogne [Mon, 20 Apr 2026 15:00:52 +0000 (17:00 +0200)] 
dnsdist: Harden the Lua FFI interface against misuse

We are getting a fair amount of AI-assisted reports involving misuse
of the Lua FFI API. While this API was always designed to be fast, leaving
a lot of opportunities to hold it wrong, we can harden it against at least
one common case: passing a dnsresponse object to a function expecting a
dnsquestion or the other way around.
Several reporters suggested the use of RTTI for that but the cost is far
from negligible. This PR uses `offsetof` and an additional `uint64` (for
alignment) field to detect this kind of misuse.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix a crash when OpenTelemetry tracing is enabled 17369/head
Remi Gacogne [Fri, 15 May 2026 08:36:18 +0000 (10:36 +0200)] 
dnsdist: Fix a crash when OpenTelemetry tracing is enabled

Reported by `ylwango613`, many thanks:
"When the operator enables OpenTelemetry tracing (the documented, supported features setOpenTelemetryTracing(true) plus SetTraceAction(true)), every incoming query passes through selectBackendForOutgoingQuery() in pdns/dnsdistdist/dnsdist.cc.

That function unconditionally dereferences the SelectedBackend returned by the load balancing policy in order to attach backend.name and backend.id attributes to the trace span. It does so without first checking that a backend was actually selected. When no backend is available (empty pool, all backends down, or a Lua policy returned std::nullopt), the SelectedBackend wraps an empty std::optional<unsigned int>, and SelectedBackend::operator->() evaluates *d_selected on a disengaged optional. This is undefined behavior, and in practice it terminates the dnsdist process either via a _GLIBCXX_ASSERTIONS abort or via a segmentation fault on a release build."

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoclang-tidy gets in the way. 17355/head
Miod Vallat [Wed, 13 May 2026 13:32:47 +0000 (15:32 +0200)] 
clang-tidy gets in the way.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
5 weeks agorequirements.txt: update version of pinned packages 17366/head
romeroalx [Fri, 15 May 2026 05:38:44 +0000 (07:38 +0200)] 
requirements.txt: update version of pinned packages

5 weeks agoDeclare lua-global-include-dir setting, for the sake of the Lua2 backend. 17365/head
Miod Vallat [Fri, 15 May 2026 05:36:17 +0000 (07:36 +0200)] 
Declare lua-global-include-dir setting, for the sake of the Lua2 backend.

Fixes #17364

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
5 weeks agoMerge pull request #17363 from hlindqvist/lmdb-shards-map-doc-clarification
Miod Vallat [Fri, 15 May 2026 05:30:30 +0000 (07:30 +0200)] 
Merge pull request #17363 from hlindqvist/lmdb-shards-map-doc-clarification

Clarify the documentation regarding lmdb-shards-map-size

5 weeks agoClarify the documentation regarding lmdb-shards-map-size 17363/head
Håkan Lindqvist [Thu, 14 May 2026 14:47:28 +0000 (16:47 +0200)] 
Clarify the documentation regarding lmdb-shards-map-size

This aligns the note in the lmdb-map-size section better
with how lmdb-map-size and lmdb-shards-map-size actually
interact.

Signed-off-by: Håkan Lindqvist <h@qw.se>
5 weeks agoauth: only apply backupSelector to the first non-empty group 17239/head
Daniel Micay [Wed, 13 May 2026 00:15:22 +0000 (20:15 -0400)] 
auth: only apply backupSelector to the first non-empty group

Example:

    local ips = {{}, {ip_dallas}}, {}, {ip_frankfurt}}
    return ifurlup(url, ips, {selector='all', backupSelector='all'})

The previous behavior results in returning {ip_dallas, ip_frankfurt} if
every IP is detected as down. Health checks start out in the down state
so every IP is considered down after a server restart or changes to the
health check configuration. For GeoDNS configurations, this means GeoDNS
doesn't work when the service is first started or if health checks start
failing for every server due to a network or configuration issue.

This changes the behavior to returning {ip_dallas} when every IP is down
which matches the behavior when every IP is up. It makes much more sense
to have the same result for every IP being up and every IP being down.

Signed-off-by: Daniel Micay <daniel.micay@grapheneos.org>
5 weeks agoFactor some code to reduce clang-tidy cognitive-complexity.
Miod Vallat [Wed, 13 May 2026 10:55:38 +0000 (12:55 +0200)] 
Factor some code to reduce clang-tidy cognitive-complexity.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
5 weeks agoSkip zone cache refresh logic if disabled.
Miod Vallat [Wed, 13 May 2026 06:02:57 +0000 (08:02 +0200)] 
Skip zone cache refresh logic if disabled.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
5 weeks agoMerge pull request #17333 from rgacogne/unbreak-clang-tidy
Remi Gacogne [Tue, 12 May 2026 14:55:44 +0000 (16:55 +0200)] 
Merge pull request #17333 from rgacogne/unbreak-clang-tidy

ci: Unbreak clang-tidy (unknown key 'IgnoredVariableNames')

5 weeks agoMerge pull request #17334 from omoerbeek/rec-docs-edns-subnet-allow
Otto Moerbeek [Tue, 12 May 2026 12:30:34 +0000 (14:30 +0200)] 
Merge pull request #17334 from omoerbeek/rec-docs-edns-subnet-allow

rec: better describe the mechanics of outgoing.edns_subnet_allow_list

5 weeks agoMerge pull request #17307 from rgacogne/ddist-fix-tcp-rate-limiting
Remi Gacogne [Tue, 12 May 2026 12:16:54 +0000 (14:16 +0200)] 
Merge pull request #17307 from rgacogne/ddist-fix-tcp-rate-limiting

dnsdist: Fix invalid TCP rate limiting computation

5 weeks agorec: better describe the mechanics of outgoing.edns_subnet_allow_list 17334/head
Otto Moerbeek [Tue, 12 May 2026 10:04:08 +0000 (12:04 +0200)] 
rec: better describe the mechanics of outgoing.edns_subnet_allow_list

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
5 weeks agoci: Unbreak clang-tidy (unknown key 'IgnoredVariableNames') 17333/head
Remi Gacogne [Tue, 12 May 2026 08:57:13 +0000 (10:57 +0200)] 
ci: Unbreak clang-tidy (unknown key 'IgnoredVariableNames')

It turns out that the clang-tidy workflow has been broken for a while on master:
```
/home/runner/work/pdns/pdns/pdns/dnsdistdist/.clang-tidy:14:1: error: unknown key 'IgnoredVariableNames'
```

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix warnings reported by clang-tidy, apply Otto's suggestions 17307/head
Remi Gacogne [Tue, 12 May 2026 08:55:07 +0000 (10:55 +0200)] 
dnsdist: Fix warnings reported by clang-tidy, apply Otto's suggestions

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Remove empty line
Remi Gacogne [Tue, 12 May 2026 08:18:22 +0000 (10:18 +0200)] 
dnsdist: Remove empty line

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Add more unit tests for concurrent TCP connections
Remi Gacogne [Tue, 12 May 2026 08:15:29 +0000 (10:15 +0200)] 
dnsdist: Add more unit tests for concurrent TCP connections

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17322 from pieterlexis/warn-on-submodule-update
Pieter Lexis [Mon, 11 May 2026 17:27:44 +0000 (19:27 +0200)] 
Merge pull request #17322 from pieterlexis/warn-on-submodule-update

ci: Add check for builder submodule

5 weeks agodnsdist: Fix flaky TCP rate limiting regression tests
Remi Gacogne [Mon, 11 May 2026 15:43:12 +0000 (17:43 +0200)] 
dnsdist: Fix flaky TCP rate limiting regression tests

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoci: Add check for builder submodule 17322/head
Pieter Lexis [Mon, 11 May 2026 13:58:45 +0000 (15:58 +0200)] 
ci: Add check for builder submodule

5 weeks agodnsdist: Fix TCP rate-limiting ban expiry (introduced in f960b7d8d98911c717ee7dfeb4dc...
Remi Gacogne [Mon, 11 May 2026 14:41:03 +0000 (16:41 +0200)] 
dnsdist: Fix TCP rate-limiting ban expiry (introduced in f960b7d8d98911c717ee7dfeb4dc6475ce98d135)

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix Python formatting
Remi Gacogne [Mon, 11 May 2026 13:13:21 +0000 (15:13 +0200)] 
dnsdist: Fix Python formatting

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoMerge pull request #17320 from miodvallat/unreserve
Miod Vallat [Mon, 11 May 2026 13:05:30 +0000 (15:05 +0200)] 
Merge pull request #17320 from miodvallat/unreserve

auth, rec: smarter memory need computation

5 weeks agodnsdist: Properly handle TCP limit tests spanning two time buckets
Remi Gacogne [Mon, 11 May 2026 13:01:16 +0000 (15:01 +0200)] 
dnsdist: Properly handle TCP limit tests spanning two time buckets

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agoCompute a less inaccurate number of dns records to pass to reserve(). 17320/head
Miod Vallat [Mon, 11 May 2026 12:23:53 +0000 (14:23 +0200)] 
Compute a less inaccurate number of dns records to pass to reserve().

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
5 weeks agodnsdist: Properly handle TCP clients that have been idle for a while
Remi Gacogne [Mon, 11 May 2026 11:14:56 +0000 (13:14 +0200)] 
dnsdist: Properly handle TCP clients that have been idle for a while

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Fix off-by-one in the TCP connection rate regression test
Remi Gacogne [Thu, 7 May 2026 16:01:22 +0000 (18:01 +0200)] 
dnsdist: Fix off-by-one in the TCP connection rate regression test

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
5 weeks agodnsdist: Only account TLS conns once we know if they were resumed
Remi Gacogne [Thu, 7 May 2026 16:00:42 +0000 (18:00 +0200)] 
dnsdist: Only account TLS conns once we know if they were resumed

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>