]> git.ipfire.org Git - thirdparty/pdns.git/log
thirdparty/pdns.git
2 months agogh actions - coveralls: avoid CI failure by setting fail-on-error: false 15624/head
romeroalx [Mon, 15 Jul 2024 10:41:57 +0000 (12:41 +0200)] 
gh actions - coveralls: avoid CI failure by setting fail-on-error: false

2 months agoMerge pull request #15572 from rgacogne/ddist19-backport-fix-obsd-tcp-crash dnsdist-1.9.10
Remi Gacogne [Tue, 20 May 2025 08:39:22 +0000 (10:39 +0200)] 
Merge pull request #15572 from rgacogne/ddist19-backport-fix-obsd-tcp-crash

dnsdist-1.9.x: Backport 15571 - Fix a crash when TCP queries and responses keep coming

2 months agodnsdist: Add a unit test for lots of pipelined queries w/ immediate response from... 15572/head
Remi Gacogne [Wed, 14 May 2025 18:33:09 +0000 (20:33 +0200)] 
dnsdist: Add a unit test for lots of pipelined queries w/ immediate response from backend

(cherry picked from commit eec9286f40665bce1cc8f07174789283bca1ac29)

2 months agodnsdist: Fix a crash when TCP queries and responses keep coming
Remi Gacogne [Tue, 13 May 2025 13:50:21 +0000 (15:50 +0200)] 
dnsdist: Fix a crash when TCP queries and responses keep coming

It happens when we keep finding queries waiting for us on the incoming
TCP socket from the client, and responses waiting for us on the TCP
socket to the backend after forwarding a new query. This is quite
unlikely but not impossible to happen, as reported by Renaud Allard
(many thanks for taking the time to investigate the issue!).

(cherry picked from commit 368f409b0768c7085602ebf4233ce1e8e4ac0f8c)

2 months agoMerge pull request #15560 from rgacogne/ddist19-backport-15520
Remi Gacogne [Mon, 19 May 2025 07:37:27 +0000 (09:37 +0200)] 
Merge pull request #15560 from rgacogne/ddist19-backport-15520

dnsdist-1.9.x: Backport 15520 - Fix building with GCC 15.1: missing `cstdint` include

2 months agoMerge pull request #15562 from rgacogne/ddist19-backport-15534
Remi Gacogne [Mon, 19 May 2025 07:37:18 +0000 (09:37 +0200)] 
Merge pull request #15562 from rgacogne/ddist19-backport-15534

dnsdist-1.9.x: Backport 15534 - Only set the proxy protocol payload size when actually added

2 months agodnsdist: Add a regression test for "restart query w/o proxy protocol" 15562/head
Remi Gacogne [Mon, 12 May 2025 10:17:18 +0000 (12:17 +0200)] 
dnsdist: Add a regression test for "restart query w/o proxy protocol"

(cherry picked from commit b53b6de99dd68b63278c5a2c6dc26cab38c04982)

2 months agodnsdist: The PP mock backend has to copy the response before editing it
Remi Gacogne [Mon, 12 May 2025 10:16:37 +0000 (12:16 +0200)] 
dnsdist: The PP mock backend has to copy the response before editing it

(cherry picked from commit 05ea9ca6bd78b4e59d41b0e5a5628d1360645ec5)

2 months agodnsdist: Reset the PP payload size when resetting the payload (restart)
Remi Gacogne [Mon, 12 May 2025 10:15:24 +0000 (12:15 +0200)] 
dnsdist: Reset the PP payload size when resetting the payload (restart)

We fixed that for UDP backends in a previous commit, but this was still
an issue for TCP-based backends.

(cherry picked from commit 00322e987270f17d2dbcd66fbd710ff4d9f4e1f1)

2 months agodnsdist: As suggested by Miod's, add the new payload size to the initial value of...
Remi Gacogne [Wed, 7 May 2025 12:56:23 +0000 (14:56 +0200)] 
dnsdist: As suggested by Miod's, add the new payload size to the initial value of zero

Co-authored-by: Miod Vallat <miod.vallat@powerdns.com>
(cherry picked from commit a462a3b02ebdbb424980c57a7adc7ac5d2e76f3d)

2 months agodnsdist: Only set the proxy protocol payload size when actually added
Remi Gacogne [Wed, 7 May 2025 08:52:56 +0000 (10:52 +0200)] 
dnsdist: Only set the proxy protocol payload size when actually added

I can think of two cases where we got this wrong:
- the query was initially assigned to a backend using the proxy protocol
  payload, then later restarted and assigned to a backend not using it.
  The proxy protocol payload size was then kept from the first assignment.
- we failed to actually prepend the proxy protocol payload but the payload
  size was updated.

Both cases could cause a corrupted payload to be sent, or an exception to
be raised if the size of the proxy protocol payload was larger than the
size of the initial query.

(cherry picked from commit 8768b9176dafc793fc3f0867c2d8964eb65378f0)

2 months agoFix building with GCC 15.1: missing `cstdint` include 15560/head
Remi Gacogne [Mon, 5 May 2025 08:42:20 +0000 (10:42 +0200)] 
Fix building with GCC 15.1: missing `cstdint` include

GCC 15.1 complains about a missing `cstdint` include when building
`DNSdist`:
```
In file included from ../doh3.hh:29,
                 from ../doh3.cc:23:
../noinitvector.hh:67:35: error: ‘uint8_t’ was not declared in this scope
   67 | using PacketBuffer = NoInitVector<uint8_t>;
      |                                   ^~~~~~~
../noinitvector.hh:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
    6 | #include <vector>
  +++ |+#include <cstdint>
    7 |
../noinitvector.hh:67:42: error: template argument 1 is invalid
   67 | using PacketBuffer = NoInitVector<uint8_t>;
      |                                          ^
In file included from ../dnsdist-idstate.hh:27,
                 from ../doh3.hh:48:
../dnscrypt.hh:247:20: error: ‘PacketBuffer’ has not been declared
  247 |   void parsePacket(PacketBuffer& packet, bool tcp, time_t now);
      |                    ^~~~~~~~~~~~
../dnscrypt.hh:248:31: error: ‘PacketBuffer’ has not been declared
  248 |   void getDecrypted(bool tcp, PacketBuffer& packet);
      |                               ^~~~~~~~~~~~
../dnscrypt.hh:249:43: error: ‘PacketBuffer’ has not been declared
  249 |   void getCertificateResponse(time_t now, PacketBuffer& response) const;
      |                                           ^~~~~~~~~~~~
../dnscrypt.hh:250:23: err
```

(cherry picked from commit a0cece2fde57774418f7bd18898e2159e9bec58b)

2 months agoMerge pull request #15561 from rgacogne/ddist19-backport-15541
Remi Gacogne [Fri, 16 May 2025 07:12:20 +0000 (09:12 +0200)] 
Merge pull request #15561 from rgacogne/ddist19-backport-15541

dnsdist-1.9.x: Backport 15541 - Gracefully handle missing v6 in backend discovery test

2 months agodnsdist: Be a bit more patient in the Backend Discovery test 15561/head
Remi Gacogne [Wed, 7 May 2025 15:00:28 +0000 (17:00 +0200)] 
dnsdist: Be a bit more patient in the Backend Discovery test

(cherry picked from commit ed97954d5c073ef228d6cbb076a27bfafc5ad1f8)

2 months agodnsdist: Gracefully handle missing v6 in backend discovery test
Remi Gacogne [Wed, 7 May 2025 14:18:25 +0000 (16:18 +0200)] 
dnsdist: Gracefully handle missing v6 in backend discovery test

This test has been randomly failing on GH actions lately, and it looks
like it is because we sometimes do not get the IPv6 addresses when
resolving `dns.quad9.net` via the system resolver.

(cherry picked from commit 3ed725fe97522e65a9997cd175fff7485676922d)

3 months agoMerge pull request #15536 from romeroalx/dnsdist-1.9.x-ubuntu-24
Remi Gacogne [Wed, 7 May 2025 11:08:37 +0000 (13:08 +0200)] 
Merge pull request #15536 from romeroalx/dnsdist-1.9.x-ubuntu-24

dnsdist-1.9.x: Switch builder and build-packages workflows to 24.04

3 months agodnsdist-1.9.x: Switch builder and build-packages workflows to 24.04 15536/head
romeroalx [Wed, 7 May 2025 00:15:12 +0000 (02:15 +0200)] 
dnsdist-1.9.x: Switch builder and build-packages workflows to 24.04

3 months agoMerge pull request #15519 from rgacogne/ddist19-backport-15514
Remi Gacogne [Mon, 5 May 2025 11:59:00 +0000 (13:59 +0200)] 
Merge pull request #15519 from rgacogne/ddist19-backport-15514

dnsdist-1.9.x: Backport 15514 - Fix memory corruption when using `getAddressInfo`

3 months agodnsdist: Fix memory corruption when using `getAddressInfo` 15519/head
Remi Gacogne [Wed, 30 Apr 2025 14:51:04 +0000 (16:51 +0200)] 
dnsdist: Fix memory corruption when using `getAddressInfo`

The object holding the callback function, which is translated into
a `LuaContext::LuaFunctionCaller`, needs to be destroyed while holding
the Lua mutex because it will unregister itself from the Lua context,
causing a corruption if a different thread is accessing the Lua context
at the same time.

(cherry picked from commit fdfda2cc394e49c83b36536e14c91f165fef5a5d)

3 months agoMerge pull request #15522 from rgacogne/ddist19-disable-coverage
Remi Gacogne [Mon, 5 May 2025 09:44:32 +0000 (11:44 +0200)] 
Merge pull request #15522 from rgacogne/ddist19-disable-coverage

dnsdist-1.9.x: Disable code coverage

3 months agodnsdist-1.9.x: Disable code coverage 15522/head
Remi Gacogne [Mon, 5 May 2025 09:11:00 +0000 (11:11 +0200)] 
dnsdist-1.9.x: Disable code coverage

It seems to be broken for now:
```
🚀 Posting coverage data to https://coveralls.io/api/v1/jobs
HTTP error:
---
Error: Payment Required (402)
Message: {"message":"Repo was paused. Check your subscription.","error":true}
---
```

and I don't really care about coverage on stable branches anyway.

3 months agoMerge pull request #15511 from rgacogne/ddist19-backport-15418
Remi Gacogne [Wed, 30 Apr 2025 14:45:20 +0000 (16:45 +0200)] 
Merge pull request #15511 from rgacogne/ddist19-backport-15418

dnsdist-1.9.x: Backport 15418 and 15471: Fix cache lookup for unavailable TCP-only backends

3 months agoMerge pull request #15510 from rgacogne/ddist19-backport-15362
Remi Gacogne [Wed, 30 Apr 2025 11:45:15 +0000 (13:45 +0200)] 
Merge pull request #15510 from rgacogne/ddist19-backport-15362

dnsdist-1.9.x: Backport 15362 - Do not register Xsk sockets on configuration check or client mode

3 months agoMerge pull request #15508 from rgacogne/ddist19-backport-15420
Remi Gacogne [Wed, 30 Apr 2025 11:44:57 +0000 (13:44 +0200)] 
Merge pull request #15508 from rgacogne/ddist19-backport-15420

dnsdist-1.9.x: Backport 15420 - Add Lua bindings for the incoming network interface

3 months agoMerge pull request #15507 from rgacogne/ddist19-backport-15440
Remi Gacogne [Wed, 30 Apr 2025 11:44:44 +0000 (13:44 +0200)] 
Merge pull request #15507 from rgacogne/ddist19-backport-15440

dnsdist-1.9.x: Backport 15440 - If SONAME is present in the generated quiche lib set it to the correct value

3 months agoMerge pull request #15506 from rgacogne/ddist19-backport-15329
Remi Gacogne [Wed, 30 Apr 2025 11:44:31 +0000 (13:44 +0200)] 
Merge pull request #15506 from rgacogne/ddist19-backport-15329

dnsdist-1.9.x: Upgrade Rust to 1.85.0

3 months agoMerge pull request #15505 from rgacogne/ddist19-backport-15300
Remi Gacogne [Wed, 30 Apr 2025 11:44:23 +0000 (13:44 +0200)] 
Merge pull request #15505 from rgacogne/ddist19-backport-15300

dnsdist-1.9.x: Backport 15300 - Allow `AF_NETLINK` and `AF_XDP` under `systemd`

3 months agoMerge pull request #15504 from rgacogne/ddist19-backport-15257
Remi Gacogne [Wed, 30 Apr 2025 11:44:14 +0000 (13:44 +0200)] 
Merge pull request #15504 from rgacogne/ddist19-backport-15257

dnsdist-1.9.x: Backport 15257 - Limit # of proxy protocol-enabled outgoing TCP connections

3 months agodnsdist: Fix an iterator out-of-bound read when removing a TCP-only server 15511/head
Remi Gacogne [Fri, 25 Apr 2025 10:14:04 +0000 (12:14 +0200)] 
dnsdist: Fix an iterator out-of-bound read when removing a TCP-only server

Introduced in https://github.com/PowerDNS/pdns/pull/15418

3 months agodnsdist: Apply Otto's suggestions
Remi Gacogne [Mon, 14 Apr 2025 07:42:50 +0000 (09:42 +0200)] 
dnsdist: Apply Otto's suggestions

(cherry picked from commit a3642df312febf731bc65d837ef47af5f89d2066)

3 months agodnsdist: Add a regression test for cache lookups w/ unavailable cache-only backends
Remi Gacogne [Thu, 10 Apr 2025 14:04:04 +0000 (16:04 +0200)] 
dnsdist: Add a regression test for cache lookups w/ unavailable cache-only backends

(cherry picked from commit a36a3e9bfc3a50735cbe63252fadd46ba984ba55)

3 months agodnsdist: Fix cache lookup for unavailable TCP-only backends
Remi Gacogne [Thu, 10 Apr 2025 13:49:51 +0000 (15:49 +0200)] 
dnsdist: Fix cache lookup for unavailable TCP-only backends

(cherry picked from commit 5f6f1444efdf400ff66f5572f676d3fabf998b68)

3 months agodnsdist: Do not register Xsk sockets on configuration check or client mode 15510/head
Remi Gacogne [Tue, 25 Mar 2025 09:55:10 +0000 (10:55 +0100)] 
dnsdist: Do not register Xsk sockets on configuration check or client mode

It does not make sense, and in some cases might lead to a crash
because the Xsk socket is actually an empty shared pointer in client
mode.

(cherry picked from commit bbd1a19e0194aabdd745c5196e1eaeb196d7e196)

3 months agoMerge pull request #15503 from rgacogne/ddist19-backport-15328
Remi Gacogne [Wed, 30 Apr 2025 10:58:11 +0000 (12:58 +0200)] 
Merge pull request #15503 from rgacogne/ddist19-backport-15328

dnsdist-1.9.x: Upgrade Quiche to 0.23.4

3 months agoMerge pull request #15502 from rgacogne/ddist19-backport-15112
Remi Gacogne [Wed, 30 Apr 2025 10:58:02 +0000 (12:58 +0200)] 
Merge pull request #15502 from rgacogne/ddist19-backport-15112

dnsdist-1.9.x: Backport 15112 - Enable XSK in our Noble Ubuntu packages

3 months agodnsdist: Fix clang-tidy warning introduced by fixing another clang-tidy warning intro... 15508/head
Remi Gacogne [Fri, 11 Apr 2025 10:41:30 +0000 (12:41 +0200)] 
dnsdist: Fix clang-tidy warning introduced by fixing another clang-tidy warning introduced by..

(cherry picked from commit 99da73d57a5a262318540ab9e46318699c19a1cc)

3 months agodnsdist: Fix clang-tidy's warning
Remi Gacogne [Fri, 11 Apr 2025 10:07:01 +0000 (12:07 +0200)] 
dnsdist: Fix clang-tidy's warning

(cherry picked from commit d6c6784884ac5633832bfa708ca264bd2d1613ec)

3 months agoAdd VRF to the list of allowed words
Remi Gacogne [Fri, 11 Apr 2025 09:35:08 +0000 (11:35 +0200)] 
Add VRF to the list of allowed words

(cherry picked from commit 8143d6a52af7bdbe2d9b8016ee0ad496512093b9)

3 months agodnsdist: Add Lua bindings for the incoming network interface
Remi Gacogne [Fri, 11 Apr 2025 09:28:51 +0000 (11:28 +0200)] 
dnsdist: Add Lua bindings for the incoming network interface

This is useful in Virtual Routing and Forwarding (VRF) environments
where the destination IP address might not be enough to identify the VRF.

(cherry picked from commit 72a24734735bf9e0cceaefa54047d015a503e033)

3 months agoUse grep -F instead of fgrep 15507/head
Otto Moerbeek [Mon, 28 Apr 2025 12:08:48 +0000 (14:08 +0200)] 
Use grep -F instead of fgrep

Co-authored-by: Remi Gacogne <github@coredump.fr>
(cherry picked from commit 57b7a0093ad46ecc50e79c0f8631e98570d72ea2)

3 months agoIf SONAME is present in the generated quiche lib set it to the correct value
Otto Moerbeek [Wed, 16 Apr 2025 11:43:03 +0000 (13:43 +0200)] 
If SONAME is present in the generated quiche lib set it to the correct value

This is needed as we rename the file. We try to not include the
SONAME, but some systems include it anyway.

(cherry picked from commit 223917e2886dd3a8fb8a72ea4267dd2fc6961c65)

3 months agoUpgrade Rust to 1.85.0 15506/head
Remi Gacogne [Tue, 18 Mar 2025 14:52:36 +0000 (15:52 +0100)] 
Upgrade Rust to 1.85.0

(cherry picked from commit 66c587404daed89dc8aeb00d2aa07156a0dc836d)

3 months agodnsdist: Allow `AF_NETLINK` and `AF_XDP` under `systemd` 15505/head
Remi Gacogne [Thu, 13 Mar 2025 19:17:29 +0000 (20:17 +0100)] 
dnsdist: Allow `AF_NETLINK` and `AF_XDP` under `systemd`

We need them for, respectively:
- IP to MAC address translation
- `XSK` packet processing

(cherry picked from commit fc01b6b5cdab8b8aee6f30298b72e79a8579c49c)

3 months agodnsdist: Remove useless `std::round()`, as suggested by Otto 15504/head
Remi Gacogne [Thu, 13 Mar 2025 08:38:54 +0000 (09:38 +0100)] 
dnsdist: Remove useless `std::round()`, as suggested by Otto

(cherry picked from commit 7b90590a78dd1ad83ae04c097bbe967db69500ef)

3 months agodnsdist: Add a regression test for Proxy Protocol conns with random values
Remi Gacogne [Fri, 7 Mar 2025 11:35:24 +0000 (12:35 +0100)] 
dnsdist: Add a regression test for Proxy Protocol conns with random values

(cherry picked from commit b2b6806c0db41938328314a813ae1cd1383d255e)

3 months agodnsdist: Clear owned downstream TCP connections as soon as possible
Remi Gacogne [Fri, 7 Mar 2025 11:34:46 +0000 (12:34 +0100)] 
dnsdist: Clear owned downstream TCP connections as soon as possible

(cherry picked from commit bcf887845bea6ac273b885da694ee70e80569824)

3 months agodnsdist: Limit # of proxy protocol-enabled outgoing TCP connections
Remi Gacogne [Thu, 6 Mar 2025 08:44:30 +0000 (09:44 +0100)] 
dnsdist: Limit # of proxy protocol-enabled outgoing TCP connections

TCP worker threads keep a cache of outgoing TCP connections to a
backend to be able to reuse them for subsequent queries. Proxy
protocol-enabled outgoing TCP connections are trickier because the
proxy protocol payload is sent only once at the beginning of the
TCP connection, contains the source and destination addresses and
ports, and thus the connections can only be reused with the exact
same incoming TCP connection. For this reason these connections are
stored in a specific structure of the incoming connection, instead
of the TCP worker connection cache. However, we can only reuse a
given proxy protocol-enabled outgoing TCP connection for a subsequent
query if the TLV values contained in the proxy-protocol payload
associated to the new query are exactly the same than the ones
associated to the existing query. Up until now, we would keep an
unbounded amount of proxy protocol-enabled connections around if
the TLV values were, for example, randomly assigned per query.
This commit sets a limit on the number of such connections we will
keep around: we will keep at most N connections, where N is the
ratio between the number of concurrent queries on a single TCP
connection supported by the backend and the number of concurrent
queries on a single TCP connection supported by the frontend, with
a hard cap to 5.

(cherry picked from commit a2d874c4f970813a768a6c6f2be62eb87be4db61)

3 months agoMerge pull request #15501 from rgacogne/ddist19-backport-15072
Remi Gacogne [Wed, 30 Apr 2025 10:33:33 +0000 (12:33 +0200)] 
Merge pull request #15501 from rgacogne/ddist19-backport-15072

dnsdist-1.9.x: Backport 15072 - Adjust Content-Type header for Prometheus endpoint to include version

3 months agoMerge pull request #15500 from rgacogne/ddist19-backport-15063
Remi Gacogne [Wed, 30 Apr 2025 10:30:03 +0000 (12:30 +0200)] 
Merge pull request #15500 from rgacogne/ddist19-backport-15063

dnsdist-1.9.x: Backport 15063 - Include cstdint to get uint64_t

3 months agoMerge pull request #15499 from rgacogne/ddist19-backport-15046
Remi Gacogne [Wed, 30 Apr 2025 10:29:54 +0000 (12:29 +0200)] 
Merge pull request #15499 from rgacogne/ddist19-backport-15046

dnsdist-1.9.x: Backport 15046 - Better error when we cannot connect a backend socket

3 months agodnsdist-1.9.x: Upgrade Quiche to 0.23.4 15503/head
Remi Gacogne [Wed, 30 Apr 2025 10:26:44 +0000 (12:26 +0200)] 
dnsdist-1.9.x: Upgrade Quiche to 0.23.4

3 months agoMerge pull request #15498 from rgacogne/ddist19-backport-15003
Remi Gacogne [Wed, 30 Apr 2025 10:17:28 +0000 (12:17 +0200)] 
Merge pull request #15498 from rgacogne/ddist19-backport-15003

dnsdist-1.9.x: Backport 15001 - Fix regression tests with Python 3.13

3 months agodnsdist-1.9.x: Enable XSK in our Noble Ubuntu packages 15502/head
Remi Gacogne [Wed, 30 Apr 2025 10:08:46 +0000 (12:08 +0200)] 
dnsdist-1.9.x: Enable XSK in our Noble Ubuntu packages

3 months agoAdjust Content-Type header for Prometheus endpoint to include version 15501/head
Wouter de Vries [Tue, 21 Jan 2025 14:18:57 +0000 (15:18 +0100)] 
Adjust Content-Type header for Prometheus endpoint to include version

Prometheus v3 will, by default, be more strict about the content-types
returned from scrape endpoints. With the current value (just
`text/plain`), it would fail to scrape.

In this commit the value is changed from `text/plain` to `text/plain;
version=0.0.4`.

See also [1] and [2]
[1] https://prometheus.io/docs/instrumenting/exposition_formats/
[2] https://prometheus.io/docs/prometheus/3.0/migration/

(cherry picked from commit f572f31ecd8d76793f1f5864ab740f6f7f7e2b84)

3 months agoInclude cstdint to get uint64_t 15500/head
Otto Moerbeek [Mon, 20 Jan 2025 10:09:42 +0000 (11:09 +0100)] 
Include cstdint to get uint64_t

Should fix #15060

(cherry picked from commit 23dd0603511f7b34f43e8d6c121aa4277d2cb317)

3 months agodnsdist: Better error when we cannot connect a backend socket 15499/head
Remi Gacogne [Thu, 16 Jan 2025 15:30:50 +0000 (16:30 +0100)] 
dnsdist: Better error when we cannot connect a backend socket

Let the user know if we are using a specific interface or source
address to contact the backend, as it is quite helpful to pinpoint
the issue.

(cherry picked from commit 199a3433672d358a53cbb4cad7d9459cf9ed4551)

3 months agoMerge pull request #15497 from rgacogne/ddist19-backport-15438
Remi Gacogne [Wed, 30 Apr 2025 09:42:21 +0000 (11:42 +0200)] 
Merge pull request #15497 from rgacogne/ddist19-backport-15438

dnsdist-1.9.x: Backport 15438 - Only pass source addresses on sockets bound to ANY

3 months agodnsdist: Fix regression tests with Python 3.13 15498/head
Remi Gacogne [Mon, 30 Dec 2024 14:55:33 +0000 (15:55 +0100)] 
dnsdist: Fix regression tests with Python 3.13

The CA certificates that we are generating as par of our regression tests
were lacking the X.509 `Key Usage` extension, causing TLS validation with
Python 3.13 to fail with:

> certificate verify failed: CA cert does not include key usage extension

It appears that Python 3.13 enables `VERIFY_X509_STRICT` by default, which makes OpenSSL stricter, and thus it chokes on our invalid CA.

(cherry picked from commit 98ef889a9232877ac369b67c11922bab92ab84a9)

3 months agodnsdist: Only pass source addresses on sockets bound to ANY 15497/head
Remi Gacogne [Tue, 15 Apr 2025 08:34:47 +0000 (10:34 +0200)] 
dnsdist: Only pass source addresses on sockets bound to ANY

FreeBSD refuses the use of `IP_SENDSRCADDR` on a socket that is
bound to a specific address, returning `EINVAL` in that case.

(cherry picked from commit 4ce6f5e8b532e103d9c16a54b92e9153ebfce2cb)

3 months agoMerge pull request #15485 from rgacogne/ddist19-backport-15481 dnsdist-1.9.9
Remi Gacogne [Tue, 29 Apr 2025 09:40:42 +0000 (11:40 +0200)] 
Merge pull request #15485 from rgacogne/ddist19-backport-15481

dnsdist-1.9.x: Backport 15481 - Gracefully handle timeout/response for a closed HTTP stream

3 months agodnsdist: Gracefully handle timeout/response for a closed HTTP stream 15485/head
Remi Gacogne [Mon, 28 Apr 2025 10:47:39 +0000 (12:47 +0200)] 
dnsdist: Gracefully handle timeout/response for a closed HTTP stream

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

(cherry picked from commit c3aab4cebf70815578e8bf449a7bce9d0827289e)

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

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

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

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

(cherry picked from commit 954eb1921699147b16f8bcd08029e37da3e789b9)

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

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

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

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

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

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

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

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

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

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

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

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

(cherry picked from commit 2b152da3e752858406189f5a360d967e8bdd816f)

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

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

(cherry picked from commit 35ab1dbe0ab9814445e8be8ba3ab7b719e1b5667)

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

(cherry picked from commit 4c6fc13c2a95bd4cf801409d12e54f2a23fa16f1)

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

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

(cherry picked from commit 05543aed8ccff2270a65d3f9b75e6e9d894b8b45)

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

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

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

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

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

(cherry picked from commit 0ffd83db942bab775a1363a373d5cb01b8455a86)

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

(cherry picked from commit a3316c3099c76aa7a21e73479c8e57cc2ff9a9d2)

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

(cherry picked from commit 8b9d0180585096d2c0ecf959aff1569edc90502b)

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

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

(cherry picked from commit 12af2075a86c11ee5441defbfe6695a609cb6eb4)

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

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

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

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

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

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

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

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

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

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

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

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

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

(cherry picked from commit d31fa785c5a9e5ba6f9d2d482e79fbf72856aa4b)

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

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

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

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

(cherry picked from commit 227a3dbf96b1c9ab4e6e3814982991be78786248)

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

(cherry picked from commit c9177f2274ce98a4130d22e2dc47b6326d206086)

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

(cherry picked from commit eb8748356f51bec98dd0626e18627d2552858d07)

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

(cherry picked from commit 0de40340927b6943a44728407fd2f1cc93c38e51)

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

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

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

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

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

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

(cherry picked from commit 2d9ed74be1fa9ecf1d5fe89ab1c544e7def7c9db)

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

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

(cherry picked from commit 093c0de7bcb357e877adc0993a7f7fe78f55add7)