Oto Šťáva [Wed, 7 Jun 2023 06:15:41 +0000 (08:15 +0200)]
tests/pytests: adapt to new pylint
New version of pylint removed the disabled `bad-continuation` check. It
also added a parens check that we were violating in
`test_random_close.py`, which is now fixed as well.
Vladimír Čunát [Mon, 29 May 2023 11:59:00 +0000 (13:59 +0200)]
lib/cache pkt_renew(): fix an edge-case bug
It could happen that this condition didn't get triggered,
but the structures weren't completely clear. In particular,
the current section could be past KNOT_ANSWER already.
Let's be more conservative here; pkt_recycle() shouldn't be expensive.
I'm not sure why I only ran into this on the new-policy branch,
but it really seems like bug here on master already.
Vladimír Čunát [Wed, 26 Apr 2023 09:16:34 +0000 (11:16 +0200)]
hints docs: explain root hints better
The removed tip seemed especially misleading;
I don't think our root hints could've ever been used that way.
And latency to root servers has practically no impact on latency
of replies to reasonable answers (just like... once per day and TLD).
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.
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.
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.
Vladimír Čunát [Thu, 22 Dec 2022 12:58:53 +0000 (13:58 +0100)]
predict: fully deactivate prediction with `period = 0`
That setting is recommended by documentation but it would still leave
the timer triggering repeatedly. Maybe it didn't cause any practical
difference, but it was unnecessary and possibly confusing.
Vladimír Čunát [Thu, 14 Jul 2022 08:53:27 +0000 (10:53 +0200)]
TTL bounds: improve the logic
- apply to first (uncached) answer already
- don't extend over signature validity
Nit: the tests were using too high TTL (RFCs disallow the "sign bit").
It was working because (manual) cache-insertion was applying bounds,
but now the bounds don't get applied anymore, so it would fail.
Vladimír Čunát [Mon, 28 Feb 2022 18:10:16 +0000 (19:10 +0100)]
lib/cache: tweak TTL computation for packets
When a whole packet is cached (instead of individual RRs),
let's simplify the way the packet's TTL gets computed.
The previous mechanism came from commit 5b383a2bb7,
probably a misunderstanding of:
https://datatracker.ietf.org/doc/html/rfc2308#section-5
Anyway, I see no motivation to do it, and this way we should
get rid of some weird cases where we might extend TTL of some records,
except if they were below the cache.min_ttl() setting (5s default).
Vladimír Čunát [Fri, 7 Oct 2022 12:06:41 +0000 (14:06 +0200)]
add option to link sbin/kresd to jemalloc
And by default do so iff jemalloc is found.
I chose the simplicity of adding the chosen allocator just
in the single binary. Other sbin/* don't matter really,
and dynamic libs (e.g. modules) will just follow whoever loaded them.
Vladimír Čunát [Mon, 21 Nov 2022 11:52:55 +0000 (12:52 +0100)]
ci/images: drop the LXC images
Last use case was dropped in 36b08eb30387,
and I don't expect we'd use this in future anymore.
The "bullseye" in README was clearly a typo (it's the codename for 11).
Vladimír Čunát [Wed, 26 Oct 2022 16:45:21 +0000 (18:45 +0200)]
ci: make jobs interruptible by default
We're usually not interested in CI on older commits,
and this default will help cancelling expensive respdiff jobs.
Also add default runner tags to make them less likely
to get underspecified. For example, each job should choose
one option in the docker/lxc and amd64/arm64 pairs.
Vladimír Čunát [Wed, 26 Oct 2022 15:55:35 +0000 (17:55 +0200)]
ci pytests: migrate away from LXC runner
This reverts commit 15c1353544be, with some modifications.
On LXC we've had issues with
FileExistsError: [Errno 17] File exists: '/tmp/pytest-kresd-portdir'
.. which disappear with this commit. (I don't know how/why.)
Vladimír Čunát [Thu, 27 Oct 2022 15:31:07 +0000 (17:31 +0200)]
doc XDP: update the list of required capabilities
We're the same as knotd in this; it evolved a bit
with libknot and kernel versions. Taken from:
https://www.knot-dns.cz/docs/3.2/singlehtml/#mode-xdp-pre-requisites
Oto Šťáva [Thu, 20 Oct 2022 11:06:31 +0000 (13:06 +0200)]
daemon/network: fix heap-buffer-overflow in endpoint key generation
Reproducible by listening on an interface by name, ASAN reports a
heap-buffer-overflow. This was a regression caused by !1286, which did
not account for null-terminators properly.