Peter van Dijk [Fri, 23 May 2025 14:50:05 +0000 (16:50 +0200)]
Introduce ZoneName::toStringFull to emit variant names...
...and use it for error report in ws-auth.
the size of this commit shows that perhaps we should have
ZoneName::toString() emit the variant. This commit will not
be folded into a previous one, so that it is easy to revert
and rework later.
The packet cache data buckets are now set up in an unordered map
addressed by the view name.
Doing this also makes sure that, if the network configuration of a view
changes, the cache contents are still valid as long as there is no
change in the zones found in that view.
Peter van Dijk [Thu, 24 Apr 2025 13:16:52 +0000 (15:16 +0200)]
Support for views on AXFR.
Note that this causes somewhat important plumbing changes, getSOA will now
take an optional zone ID, which callers should provide if they know it, in
order to save a possible expensive getDomainInfo call.
Peter van Dijk [Mon, 7 Apr 2025 13:25:39 +0000 (15:25 +0200)]
Introduce a Bind-style Views feature.
Add interfaces to the zone cache to get the view name from the
originating network address, and to retrieve the appropriate
variant name to use to update a ZoneName when necessary.
Remi Gacogne [Thu, 22 May 2025 14:34:58 +0000 (16:34 +0200)]
dnsdist: Fix the behaviour of `TagRule` with an empty string as value
Before 2.0.0 passing an empty value to `TagRule` meant that only the
presence of the tag with an empty value would be accepted. That
behaviour changed when we introduced the YAML configuration format,
refactoring the selectors in the process, to instead mean that an
empty string meant that all values would be accepted, only the tag
presence being checked. This is an unfortunate side-effect of a
limitation of the `cxx` Rust <-> C++ interoperability layer that we
are using (lack of support for `Option<T>` <-> `std::optional<T>`,
namely). This PR fixes restores the exising behaviour by adding an
additional boolean to the YAML configuration, and ensuring that
passing an empty value to the Lua configuration is not treated as
not passing any value.
Remi Gacogne [Tue, 20 May 2025 08:09:09 +0000 (10:09 +0200)]
dnsdist: Fix one potential issue spotted by Coverity
As spotted by Coverity, one function called from a destructor could
in theory throw an exception which is not caught from within the
destructor, which would lead to a termination of the program.
At a quick glance it seems quite impossible to happen in practice
with the current code, but let's fix it nevertheless.
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!).
Remi Gacogne [Thu, 15 May 2025 10:13:09 +0000 (12:13 +0200)]
build-and-test-all: Build DNSdist on Ubicloud runners when needed
GH actions provides us with a 16 GB runner on public repositories,
but only 7 GB on private ones. Unfortunately our current workflow
assumes that we can get away with 4 concurrent jobs when building
DNSdist, which is true when we have 16 GB available but not with
7 GB.
So this commit switches to Ubicloud runners (standard 4, 4 vCPU,
16 GB) for repositories defining the `REPOSITORY_USE_UBICLOUD`
variable to 1. These runners are also significantly faster than the
GH actions ones.
Remi Gacogne [Mon, 19 May 2025 09:45:59 +0000 (11:45 +0200)]
dnsdist: Fix our `meson` build not reaching a stable state
Before this commit calling `meson build` a second time right after building
triggered a re-generation of the `dnsdist-configuration-yaml-items-generated.cc`
file because `meson` wants it to be present in the build directory,
but we also want to generate it in the source directory so that it
can be included in the repository.
The current solution is a bit dirty, but our options are limited
because some files are only generated when YAML support is available,
because they require Rust, and we need them to be in the dist tarball.
Otto suggested that we could generate them only when building the dist
tarball, I'll look into it in a bit.
Remi Gacogne [Thu, 15 May 2025 08:11:23 +0000 (10:11 +0200)]
dnsdist: Fix backend discovery regression test on GH action (again)
Apparently IPv6 is very flaky on GH actions these days, and I see
this test failing again and again because DNSdist cannot reliably
reach the servers over IPv6. IPv4 is fine from GH actions, v4 and
v6 are fine locally, so let's not fail in that case.