Vladimír Čunát [Mon, 8 May 2023 08:39:41 +0000 (10:39 +0200)]
ci: drop debian 9
It looks like downloads won't work anymore:
https://gitlab.nic.cz/knot/knot-resolver/-/jobs/890201
https://gitlab.nic.cz/knot/knot-resolver/-/jobs/890312
which is probably because long-term support ended last summer.
Oto Šťáva [Tue, 21 Mar 2023 06:35:19 +0000 (07:35 +0100)]
daemon/session2: rename http flag to custom_emalf_handling
The session2 API as well as everything that uses it should be as
independent of the underlying protocols as possible, providing
functionality through firing different events. There was a left-over
`struct session2::http` flag, which allowed the DoH layer to return a
Bad Request reply. This has been renamed so that it does not mention
HTTP apart from the example in the doc comments, in case another
protocol needs to use this functionality at some point.
Oto Šťáva [Wed, 15 Mar 2023 07:19:42 +0000 (08:19 +0100)]
daemon: use a struct member for 'inheritance' to avoid aliasing issues
It has been brought to my attention that using a macro to put an
identical member sequence at the beginning of multiple structs to
simulate OOP-like inheritance (the way libUV does it) may violate strict
aliasing rules. The standards-compliant way to do this should be to use
a single common struct member, as opposed to a common sequence of
members. This commit fixes this potential problem on our side.
Side note: even without this measure, it should not be causing any
problems for us, since we have '-fno-strict-aliasing' in our
meson.build. But in case libUV fixes their side at some point, let us
just have one less thing to worry about on our side.
Oto Šťáva [Fri, 10 Mar 2023 12:15:16 +0000 (13:15 +0100)]
daemon: improve session closure readability
Until now, sessions were closed by explicitly sending `_CLOSE` events
via the `session2_event()` function to them, which I think is not
signalling the intent very well. It might look as though the session
has been/is being closed by some part of the code that contains the
`session2_event()` call and a relevant event is being fired now. This
commit introduces `session2_close()` and `session2_force_close()` inline
functions, which do the same thing, but I think the intent behind
calling them is slightly clearer.
Vladimír Čunát [Wed, 8 Mar 2023 16:18:16 +0000 (17:18 +0100)]
improve handling of SERVFAIL from forwarders
- selection: utilize address_state::broken also when forwarding
- selection: drop fallbacks that don't make sense when forwarding
- iterate: copy EDE codes on DNSSEC SERVFAILs
Vladimír Čunát [Tue, 21 Feb 2023 14:35:14 +0000 (15:35 +0100)]
view: fix destination-based matching
Apparently it's never worked since its introduction.
.addr is non-nil exactly when .dst_addr is non-nil
(which hapens iff the query originated externally).
Now we have semantics which was probably intended by the original code
(982162956a from 2016) but that semantics is still problematic
if you need both kinds of matching in a single request from client.
This matching by destination has never made it to docs,
so let's just add this simple fixup for now, and later
we'll steer users to new policy configuration anyway.
The hack shouldn't be needed anymore:
https://github.com/Homebrew/homebrew-core/commit/4369052170f4360b7ad545f23b8a01a4ccb37683#diff-59a7902ada251dd9dba99b5bd323c1dba1d102d244ce766c06ce00097fb82e8fL71
This isn't an exact revert, but differences are minor.
Oto Šťáva [Fri, 24 Feb 2023 10:08:59 +0000 (11:08 +0100)]
daemon/engine: warning when log_groups contains a non-existent group
Until now, kresd would refuse to start when a log_groups Lua call
contained a non-existent group. After this change, only a warning is
printed, which helps during development while switching between branches
with new logging groups. I don't think changing the configuration all
the time just for a logging group is warranted.
Vladimír Čunát [Mon, 13 Feb 2023 15:59:11 +0000 (16:59 +0100)]
lib/utils: fix timestamp format in dumps of records
The debug dumps of packets used UNIX timestamps (in RRSIG validity)
instead of the customary human stamps.
This was an unintentional regression of 0555828e, i.e. since v5.4.1
I looked again at all other differences from default kdig style,
and the only ones are that we don't show class and don't do IDN.
(both seem suitable here)
Vladimír Čunát [Wed, 22 Feb 2023 10:44:10 +0000 (11:44 +0100)]
ci: fix macOS builds
Let's specify more of the dependencies explicitly.
I suspect it was pkg-config that was missing;
https://github.com/CZ-NIC/knot-resolver/actions/runs/4241689540/jobs/7372234570
Oto Šťáva [Thu, 26 Jan 2023 07:45:24 +0000 (08:45 +0100)]
tests/pytests: quality-of-life improvements and notes
Added the option to run `kresd` inside `pytests` under `valgrind` and
`rr`, which can help with debugging. Also added a clarifying note that I
personally would have liked to have while exploring this.
Oto Šťáva [Tue, 31 Jan 2023 08:24:03 +0000 (09:24 +0100)]
daemon: make closing more session-centric
Should clear up some memory ownership issues and strange behaviour when
closing I/O handles.
Also, sessions now count their owned handles, because libUV apparently
does not guarantee the order of uv_close, so sometimes the closure of a
session handle would cause a use-after-free because the session's timer
has not yet been properly closed.
Vladimír Čunát [Thu, 26 Jan 2023 16:07:01 +0000 (17:07 +0100)]
ci: allow failure for bad OBS distrotest jobs
They've been failing for many months, e.g. see
https://gitlab.nic.cz/knot/knot-resolver/-/pipelines/104497
This way it at least won't be confusing by showing red in CI.