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.
Oto Šťáva [Wed, 21 Sep 2022 06:50:14 +0000 (08:50 +0200)]
daemon: adapt DNS-over-HTTPS for protocol layers
Has a few problems that need to be solved:
- Answers are being truncated, because PROTOLAYER_DNS_DGRAM treats the
communication as UDP. Since `session->stream` has multiple
responsibilities, it needs to be split up into two (or more)
different flags; then we'll be able to use it properly.
- There is an unsolved use-after-free
Oto Šťáva [Fri, 5 Aug 2022 06:22:37 +0000 (08:22 +0200)]
daemon: protolayer timeout and stream fixes
Incoming TCP sessions (from clients) were not marked as `connected`,
causing the wrong timeout function to be called. This may have resulted
in assertion failures in some cases when using TCP.
Some error codes were not wrapped in `kr_error` - this probably did not
cause any real issues currently, but for the sake of consistency this is
now fixed.
Stream wire buffers were not being processed in a loop, which could
potentially cause input data to be discarded or processed with a delay.
This is now fixed.
Oto Šťáva [Thu, 4 Aug 2022 09:15:13 +0000 (11:15 +0200)]
daemon/session2: put event handling into separate functions
Originally, events were simply just another payload for the regular data
callbacks. That could, however, lead to problems with the control flow
of the layer iterations, e.g. when a buffer causes a layer to `_WAIT`,
but the next payload is an event instead of another buffer. This
separation should fix that problem.