Jakub Ružička [Tue, 11 Jul 2023 10:43:24 +0000 (12:43 +0200)]
distro/pkg/rpm: require setuptools on suse
Otherwise:
Traceback (most recent call last):
File "/builddir/build/BUILD/knot-resolver-6.0.1.dev90+5003e3/manager/setup.py", line 2, in <module>
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
Vladimír Čunát [Wed, 28 Jun 2023 08:17:41 +0000 (10:17 +0200)]
deprecate legacy systemd units
- separate meson option, disabled by default
- deb,rpm: don't install these legacy units
- deb,rpm: use the new knot-resolver.service on all the places
Vladimír Čunát [Wed, 28 Jun 2023 15:48:51 +0000 (17:48 +0200)]
avoid knot_pkt_default_padding_size()
The reserved size in packet is a messy thing, broken by
https://gitlab.nic.cz/knot/knot-dns/-/commit/ded5fbf01d00a875f141
Fortunately this function is trivial, so we can inline what we need.
It gets complicated by an earlier typo fix, though.
Vladimír Čunát [Sat, 10 Jun 2023 08:34:12 +0000 (10:34 +0200)]
hints: fix names inside home.arpa.
Reported on https://forum.turris.cz/t/knot-resolver-with-local-fqdn-hostnames/19034/8
I write it as three comparisons, as it seems like a simple way of
still running only a single comparison in the typical case of QNAME
not falling under .arpa.
Tested just quickly, manually. This chunk of code already is replaced
for kresd >= 6.0.0.
Vladimír Čunát [Fri, 9 Jun 2023 19:30:01 +0000 (21:30 +0200)]
ci: drop `doc`; we have `pages` instead now
The `pages` job works. We might consolidate this later,
also e.g. drop the doc dependencies from the default image
if we won't really use that image for docs anymore.
Vladimír Čunát [Tue, 6 Jun 2023 14:13:57 +0000 (16:13 +0200)]
lib/rules,cache: use transactions, improve assertions
When inserting rules from a config file, process everything
in a single transaction to avoid using inconsistent sets of rules,
especially in a different instance and/or in case some error happens.
Vladimír Čunát [Wed, 24 May 2023 11:05:13 +0000 (13:05 +0200)]
ci lint:scan-build: fix the error count
The new reports are:
./lib/rules/api.c:301:3: warning: Memory copy function overflows destination buffer
memcpy(key_data_ruleset_end, &KEY_EXACT_MATCH, sizeof(KEY_EXACT_MATCH));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/rules/api.c:506:2: warning: Memory copy function overflows destination buffer
memcpy(key.data, &KEY_EXACT_MATCH, sizeof(KEY_EXACT_MATCH));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/rules/api.c:699:2: warning: Memory copy function overflows destination buffer
memcpy(key.data, &KEY_ZONELIKE_A, sizeof(KEY_ZONELIKE_A));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
I re-checked those places, and I believe they can never overflow.
I regularly run with ASAN as well, which would catch overflows.
I can't see a simple way of amending the code in a way
that the linter might be happy.
Vladimír Čunát [Wed, 24 May 2023 10:12:42 +0000 (12:12 +0200)]
lib: tweak selection errors when consuming cached answer
Forwarding-related changes uncovered this case
in integration.iter_limits test. Errors can happen also
when consuming data produced by cache, in which case there's
no suitable server to blame for the error.
Vladimír Čunát [Fri, 19 May 2023 07:09:06 +0000 (09:09 +0200)]
lib/rules: implement forwarding
Typical use cases should work now, briefly tested:
- forwarding all to a resolver
- forwarding a subtree downgraded to insecure (to resolver or auth)
- forwarding a subtree to auth without changing DNSSEC chain (atypical)
In some places we need to repeat kr_make_query()
The issue is that some of its inputs (e.g. STUB/FORWARD, zone cut)
are now not known at the beginning of PRODUCE yet.
Also, checking that QNAME matches is useless on a cached reply.
Vladimír Čunát [Sun, 7 May 2023 07:46:21 +0000 (09:46 +0200)]
lib/resolve.c: split in two files
I know that moving code makes e.g. blaming harder,
but this was a really long file now.
This commit _only_ moves code, except for nits:
- minor pieces moved into an -impl.h shared by both resolve*.c
There a couple functions changed to non-static or static inline.
- order is preserved, for now at least
Vladimír Čunát [Fri, 28 Apr 2023 09:19:33 +0000 (11:19 +0200)]
lib/rules: add API for loading a zonefile
Two main use cases are actual RPZ file
and also the /local-data/records string (plain RRsets).
The RPZ semantics isn't very close to the specs,
but I believe the practical usability is already better
than our old RPZ implementation, thanks to following CNAMEs.
Vladimír Čunát [Wed, 22 Jul 2020 16:43:04 +0000 (18:43 +0200)]
new policy engine - prototype
Picked up old work, rebase-squashed after many months;
then fixed up a little as needed in this newer version.
(and later many minor fixes got squashed in)
Vladimír Čunát [Wed, 22 Jul 2020 08:29:16 +0000 (10:29 +0200)]
lib/cache: simplify passing qry/req parameters
- kr_layer_t isn't really useful in the inner functions
(it's mainly useful through ->state when returning from layer)
- kr_query seems a little more suitable to pass than kr_request