]> git.ipfire.org Git - thirdparty/pdns.git/log
thirdparty/pdns.git
3 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

3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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()`

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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

3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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

3 weeks agoClarify the documentation regarding lmdb-shards-map-size 17363/head
HaÌŠ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: HaÌŠkan Lindqvist <h@qw.se>
3 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>
3 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>
3 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>
3 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')

3 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

3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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

3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 weeks agodnsdist: Fix invalid TCP rate limiting computation
Remi Gacogne [Thu, 7 May 2026 15:48:13 +0000 (17:48 +0200)] 
dnsdist: Fix invalid TCP rate limiting computation

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
3 weeks agoMerge pull request #17297 from omoerbeek/rec-auth-corsflag
Otto Moerbeek [Mon, 11 May 2026 08:37:57 +0000 (10:37 +0200)] 
Merge pull request #17297 from omoerbeek/rec-auth-corsflag

rec and auth: Implement an allow cors flag in a simlar way dnsdist has

3 weeks agoApply suggestions from code review 17297/head
Otto Moerbeek [Mon, 11 May 2026 07:20:01 +0000 (09:20 +0200)] 
Apply suggestions from code review

Co-authored-by: Miod Vallat <miod.vallat@powerdns.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
3 weeks agoRename the option to [webserver-]cross-origin-request-header
Otto Moerbeek [Mon, 11 May 2026 07:14:30 +0000 (09:14 +0200)] 
Rename the option to [webserver-]cross-origin-request-header

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agobuild(deps): bump sigstore/cosign-installer from 4.1.1 to 4.1.2 17306/head
dependabot[bot] [Thu, 7 May 2026 14:42:12 +0000 (14:42 +0000)] 
build(deps): bump sigstore/cosign-installer from 4.1.1 to 4.1.2

Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 4.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
4 weeks agoWhen deleting an ENT record, only delete associated NSEC3 record if orphaned. 17304/head
Miod Vallat [Thu, 7 May 2026 12:43:17 +0000 (14:43 +0200)] 
When deleting an ENT record, only delete associated NSEC3 record if orphaned.

The existing logic was assuming that operations causing ENT records to
disappear take place before actual records are added, but there is
absolutely no such ordering guarantee. rectifyZone() would then create the
proper NSEC ordering, before deleting leftover ENT; but that last step
would also delete the NSEC3 chaining, requiring users to rectify their zone
a second time.

Fixes: #16816
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoAdd a test demonstrating the defect described in #16816.
Miod Vallat [Thu, 7 May 2026 12:36:33 +0000 (14:36 +0200)] 
Add a test demonstrating the defect described in #16816.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoMove to a string instead of a boolean flag, as suggested by zeha
Otto Moerbeek [Thu, 7 May 2026 12:20:38 +0000 (14:20 +0200)] 
Move to a string instead of a boolean flag, as suggested by zeha

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agoAdd docs and rename auth setting name
Otto Moerbeek [Thu, 7 May 2026 10:12:00 +0000 (12:12 +0200)] 
Add docs and rename auth setting name

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agoMerge pull request #17135 from rgacogne/ddist-also-set-udp-buffer-size-for-backend
Remi Gacogne [Thu, 7 May 2026 09:33:30 +0000 (11:33 +0200)] 
Merge pull request #17135 from rgacogne/ddist-also-set-udp-buffer-size-for-backend

dnsdist: Also apply UDP socket buffer sizes to backend sockets

4 weeks agoUpdate regression-tests.api/test_Basics.py
Otto Moerbeek [Thu, 7 May 2026 08:28:52 +0000 (10:28 +0200)] 
Update regression-tests.api/test_Basics.py

Co-authored-by: Remi Gacogne <github@coredump.fr>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agoDrop the origin part, fix auth regression test
Otto Moerbeek [Thu, 7 May 2026 08:23:25 +0000 (10:23 +0200)] 
Drop the origin part, fix auth regression test

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agoMerge pull request #17291 from rgacogne/ddist-document-api-read-write-flush
Remi Gacogne [Wed, 6 May 2026 15:48:12 +0000 (17:48 +0200)] 
Merge pull request #17291 from rgacogne/ddist-document-api-read-write-flush

dnsdist: Document that flushing the cache is allowed in read-only mode

4 weeks agoMerge pull request #17290 from rgacogne/ddist-remove-ffi-pp-dead-code
Remi Gacogne [Wed, 6 May 2026 11:25:18 +0000 (13:25 +0200)] 
Merge pull request #17290 from rgacogne/ddist-remove-ffi-pp-dead-code

dnsdist: Bail out when a `NULL` pointer is passed to `dnsdist_ffi_dnsquestion_get_proxy_protocol_values`

4 weeks agoMerge pull request #17285 from omoerbeek/rec-byterreccheck
Otto Moerbeek [Wed, 6 May 2026 08:46:10 +0000 (10:46 +0200)] 
Merge pull request #17285 from omoerbeek/rec-byterreccheck

rec: check bytes received limit immediate after increase

4 weeks agoImplement an allow cors flag in a simlar way dnsdist has
Otto Moerbeek [Thu, 23 Apr 2026 12:55:53 +0000 (14:55 +0200)] 
Implement an allow cors flag in a simlar way dnsdist has

Docs and tests missing

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agoMerge pull request #17283 from omoerbeek/rec-src-rem-log
Otto Moerbeek [Wed, 6 May 2026 08:14:59 +0000 (10:14 +0200)] 
Merge pull request #17283 from omoerbeek/rec-src-rem-log

rec: be more consistent in logging source and remote

4 weeks agodnsdist: Document that flushing the cache is allowed in read-only mode 17291/head
Remi Gacogne [Tue, 5 May 2026 13:22:58 +0000 (15:22 +0200)] 
dnsdist: Document that flushing the cache is allowed in read-only mode

As reported by Prasanna Dabi (thanks!) one might expect that a read-only
API would not allow the flushing of the packet cache. This is not the case,
the read-only flag controls whether the API is allowed to alter the configuration,
but flushing the content of the packet cache is always allowed.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agodnsdist: Bail out when a `NULL` pointer is passed to `dnsdist_ffi_dnsquestion_get_pro... 17290/head
Remi Gacogne [Tue, 5 May 2026 09:17:19 +0000 (11:17 +0200)] 
dnsdist: Bail out when a `NULL` pointer is passed to `dnsdist_ffi_dnsquestion_get_proxy_protocol_values`

Reported by ylwango613, thanks!

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agoMerge pull request #17287 from rgacogne/ddist-ebpf-add-range-rule
Remi Gacogne [Tue, 5 May 2026 08:59:14 +0000 (10:59 +0200)] 
Merge pull request #17287 from rgacogne/ddist-ebpf-add-range-rule

dnsdist: Fix `BPFFilter::addRangeRule`

4 weeks agoMerge pull request #17288 from rgacogne/ddist-fix-null-ptr-deref-verbose-doh-healthcheck
Remi Gacogne [Mon, 4 May 2026 14:59:09 +0000 (16:59 +0200)] 
Merge pull request #17288 from rgacogne/ddist-fix-null-ptr-deref-verbose-doh-healthcheck

dnsdist: Fix a crash with DoH backends in verbose health-check mode

4 weeks agoMerge pull request #17289 from omoerbeek/rec-optimize-dns64
Otto Moerbeek [Mon, 4 May 2026 14:00:59 +0000 (16:00 +0200)] 
Merge pull request #17289 from omoerbeek/rec-optimize-dns64

rec: optimize dns64 PTR processing (#YWH-PGM6095-280)

4 weeks agodnsdist: Fix a crash with DoH backends in verbose health-check mode 17288/head
Remi Gacogne [Mon, 4 May 2026 12:53:10 +0000 (14:53 +0200)] 
dnsdist: Fix a crash with DoH backends in verbose health-check mode

Reported by Mehtab Zafar, many thanks!

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agorec: optimize dns64 PTR processing (#YWH-PGM6095-280) 17289/head
Otto Moerbeek [Mon, 4 May 2026 12:47:27 +0000 (14:47 +0200)] 
rec: optimize dns64 PTR processing (#YWH-PGM6095-280)

And return ServFail on malformed DNS64 PTR queries

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agodnsdist: Fix `BPFFilter::addRangeRule` 17287/head
Remi Gacogne [Mon, 4 May 2026 12:38:58 +0000 (14:38 +0200)] 
dnsdist: Fix `BPFFilter::addRangeRule`

Reported by Prasanna Dabi (thanks!):
"The eBPF DDoS mitigation implementation in dnsdist contains a critical logic error that prevents new range-based block rules from being applied. When the BPFFilter::addRangeRule() function is called to block a subnet, it first checks the eBPF map to determine if the rule already exists. If the subnet is not currently in the map, the bpf_lookup_elem call returns -1. In this failure state, the local CounterAndActionValue value struct remains in its default, zeroed-out state, where the action field is automatically set to BPFFilter::MatchAction::Pass.

The conditional check intended to skip redundant rules contains a logic typo: it evaluates value.action == BPFFilter::MatchAction::Pass instead of comparing the requested action parameter.Because the default state of the unpopulated struct is always Pass, the condition (res == -1 && value.action == BPFFilter::MatchAction::Pass) evaluates to true for every new rule attempt.This causes the daemon to throw a std::runtime_error and reject the mitigation."

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
4 weeks agoMerge pull request #17286 from miodvallat/beaucoupfish
Miod Vallat [Mon, 4 May 2026 12:31:07 +0000 (14:31 +0200)] 
Merge pull request #17286 from miodvallat/beaucoupfish

auth, dnsdist: lost+found, faster

4 weeks agoMerge pull request #17284 from miodvallat/grossbody
Miod Vallat [Mon, 4 May 2026 12:30:13 +0000 (14:30 +0200)] 
Merge pull request #17284 from miodvallat/grossbody

auth, dnsdist: use less inefficient code in web server

4 weeks agoPrefer std::string::find(char) when searching for a single character. 17286/head
Miod Vallat [Mon, 4 May 2026 11:50:59 +0000 (13:50 +0200)] 
Prefer std::string::find(char) when searching for a single character.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoMerge pull request #17240 from miodvallat/hardenxfr
Miod Vallat [Mon, 4 May 2026 11:42:23 +0000 (13:42 +0200)] 
Merge pull request #17240 from miodvallat/hardenxfr

auth: harden xfr*BitInt writers

4 weeks agoMissing ; 17285/head
Otto Moerbeek [Mon, 4 May 2026 10:04:24 +0000 (12:04 +0200)] 
Missing ;

Co-authored-by: Miod Vallat <miod.vallat@powerdns.com>
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agorec: check bytes received limit immediate after increase
Otto Moerbeek [Mon, 4 May 2026 09:56:07 +0000 (11:56 +0200)] 
rec: check bytes received limit immediate after increase

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
4 weeks agoMaintain a "current size of received body" counter. 17284/head
Miod Vallat [Mon, 4 May 2026 09:46:09 +0000 (11:46 +0200)] 
Maintain a "current size of received body" counter.

This allows us to get rid of synthesizing partial body contents as
std::string objects, only to check for their length being still within
allowed bounds.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agoWiden types passed to xfr*BitInt to reject too large values. 17240/head
Miod Vallat [Fri, 24 Apr 2026 06:33:54 +0000 (08:33 +0200)] 
Widen types passed to xfr*BitInt to reject too large values.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
4 weeks agorec: be more consistent in logging soure and remote 17283/head
Otto Moerbeek [Mon, 4 May 2026 09:21:35 +0000 (11:21 +0200)] 
rec: be more consistent in logging soure and remote

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>