]>
git.ipfire.org Git - thirdparty/knot-resolver.git/log
Tomas Krizek [Wed, 26 May 2021 08:03:51 +0000 (08:03 +0000)]
Merge branch 'improve-assertions' into 'master'
lib/utils: define kr_require(), kr_assume() macros
Closes #495
See merge request knot/knot-resolver!1146
Tomas Krizek [Tue, 25 May 2021 12:17:23 +0000 (14:17 +0200)]
treewide: rename assumptions to kr_assert() / kr_fails_assert()
To (hopefully) improve readability, rename the typical macro usage of:
if (!kr_assume(x)) y; // to
if (kr_fails_assert(x)) y;
As a convenience, replace the assert without a return value to a more
simple version:
(void)!kr_assume(x); // becomes
kr_assert(x);
Tomas Krizek [Tue, 25 May 2021 10:40:01 +0000 (12:40 +0200)]
lib/dnssec/ta.c: replace asserts
Vladimír Čunát [Mon, 17 May 2021 11:05:02 +0000 (13:05 +0200)]
lib/utils kr_ranked_rrarray_add(): clarify RRset sizes
Vladimír Čunát [Fri, 14 May 2021 09:05:05 +0000 (11:05 +0200)]
lib/cache assertions: saving to cache is not critical
Vladimír Čunát [Fri, 14 May 2021 08:44:26 +0000 (10:44 +0200)]
lib/cache: simplify rdataset_dematerialize()
Trying to handle the NULL here was pointless, so let's simplify.
As it was, it couldn't trigger anyway (would crash earlier).
Vladimír Čunát [Wed, 12 May 2021 17:22:01 +0000 (19:22 +0200)]
lib/cache entry2answer(): trigger failures before jumps
It's a little more verbose, but it should be more valuable in case
we encounter them.
Vladimír Čunát [Wed, 12 May 2021 17:03:37 +0000 (19:03 +0200)]
treewide: minor C11 cleanup
Vladimír Čunát [Wed, 12 May 2021 11:48:00 +0000 (13:48 +0200)]
lib/utils kr_fail(): don't mangle errno
Lukáš Ježek [Fri, 23 Apr 2021 08:49:47 +0000 (10:49 +0200)]
lib/cookies/nonce.c: remove assert.h include
Vladimír Čunát [Thu, 15 Apr 2021 12:28:35 +0000 (14:28 +0200)]
treewide: eradicate "assert" in comments to fix CI
Vladimír Čunát [Thu, 15 Apr 2021 11:59:48 +0000 (13:59 +0200)]
ci: check for "assert" in most C files
Vladimír Čunát [Thu, 15 Apr 2021 10:07:09 +0000 (12:07 +0200)]
lib/utils kr_fail(): simple rate limit for forking
Default 5 minutes (but off).
Randomize the delays +-25%.
Tomas Krizek [Fri, 26 Mar 2021 14:41:29 +0000 (15:41 +0100)]
doc: document debugging options
Tomas Krizek [Fri, 26 Mar 2021 13:14:01 +0000 (14:14 +0100)]
doc: mention DEBUG_* policies for debugging requests
Tomas Krizek [Fri, 19 Mar 2021 15:47:34 +0000 (16:47 +0100)]
daemon: allow kr_assume() configuration
- add lua options debugging.assumption_abort and
debugging.assumption_fork to make the behaviour configurable
- select default values based on meson buildtype:
- debug/debugoptimized (default, e.g. used in CI) - abort and don't
fork
- plain/release - don't abort, but fork if abort is user-configured
Tomas Krizek [Wed, 24 Mar 2021 16:44:49 +0000 (17:44 +0100)]
utils/client/kresc.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
utils/cache_gc/main.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
utils/cache_gc/kr_cache_gc.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
utils/cache_gc/db.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
modules/stats/stats.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
modules/hints/hints.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
modules/dnstap/dnstap.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
modules/cookies/cookies.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
modules/cookies/cookiemonster.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:48 +0000 (17:44 +0100)]
modules/cookies/cookiectl.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/zonecut.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/utils.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/utils.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/selection_iter.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/selection_forward.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/selection.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/rplan.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/resolve.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:47 +0000 (17:44 +0100)]
lib/resolve.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/module.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/layer/validate.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/layer/iterate.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/generic/trie.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/generic/queue.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/generic/queue.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/generic/pack.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)]
lib/generic/lru.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:45 +0000 (17:44 +0100)]
lib/generic/lru.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:45 +0000 (17:44 +0100)]
lib/dnssec/signature.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:45 +0000 (17:44 +0100)]
lib/dnssec/nsec3.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:45 +0000 (17:44 +0100)]
lib/dnssec/nsec.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:45 +0000 (17:44 +0100)]
lib/dnssec/nsec.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:45 +0000 (17:44 +0100)]
lib/dnssec.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:45 +0000 (17:44 +0100)]
lib/cookies/helper.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cookies/alg_sha.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cookies/alg_containers.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cache/peek.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cache/nsec3.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cache/nsec1.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cache/knot_pkt.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cache/impl.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:44 +0000 (17:44 +0100)]
lib/cache/entry_rr.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
lib/cache/entry_pkt.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
lib/cache/entry_list.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
lib/cache/cdb_lmdb.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
lib/cache/api.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
daemon/zimport.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
daemon/worker.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
daemon/udp_queue.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
daemon/tls_session_ticket-srv.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:43 +0000 (17:44 +0100)]
daemon/tls.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/session.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/network.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/main.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/io.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/http.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/ffimodule.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/engine.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:42 +0000 (17:44 +0100)]
daemon/bindings/net.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:41 +0000 (17:44 +0100)]
daemon/bindings/impl.h: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 16:44:41 +0000 (17:44 +0100)]
daemon/bindings/cache.c: replace asserts
Tomas Krizek [Wed, 24 Mar 2021 13:21:28 +0000 (14:21 +0100)]
meson: disable assetions
This primarily affects dependency headers and contrib code, as kresd now
uses kr_require() or kr_assume() instead of assert().
Tomas Krizek [Wed, 3 Mar 2021 14:45:59 +0000 (15:45 +0100)]
lib/utils: define kr_require(), kr_assume() macros
These macros should replace the use of assert() in our entire codebase.
assert() have the following issues:
- can be turned off at compilation time
- they don't have consistent meaning in our code
kr_require() behaves similarly to assert - it checks a condition and
aborts if it fails. Unlike asserts, these aren't turned off by using
-DNDEBUG. kr_require() should be used for non-recoverable errors.
kr_assume() is a way to check for non-fatal errors which supports error
reporing, debugging and recovery. The function returns a boolean value
which the caller must use for error handling. An error log message is
produced when the condition fails. Optionally, when kr_debug_assumption
is set to true, the process will use fork() and the child will abort().
This generates a coredump for debugging purposes, while allowing the
parent process to keep running and recover from the non-fatal error.
This can be useful for debugging hard to reproduce errors in production
environments.
Tomas Krizek [Mon, 24 May 2021 13:44:10 +0000 (13:44 +0000)]
Merge branch 'expose-http-headers' into 'master'
daemon/http: expose HTTP headers to kr_request
Closes #616
See merge request knot/knot-resolver!1165
Lukáš Ježek [Wed, 21 Apr 2021 10:33:46 +0000 (12:33 +0200)]
doc: add DoH configuration net.doh_headers
Lukáš Ježek [Wed, 21 Apr 2021 09:33:40 +0000 (11:33 +0200)]
daemon/http: add expose headers config test
Tomas Krizek [Thu, 8 Apr 2021 15:38:43 +0000 (17:38 +0200)]
nitpick: fix lint:tidy warnings
Tomas Krizek [Thu, 8 Apr 2021 15:14:47 +0000 (17:14 +0200)]
bindings/net: rename to doh_headers()
Tomas Krizek [Thu, 8 Apr 2021 14:25:01 +0000 (16:25 +0200)]
lib/resolve: make qsource.headers a struct instead of pointer
Tomas Krizek [Thu, 8 Apr 2021 11:53:59 +0000 (13:53 +0200)]
daemon/http: expose only chosen headers and limit max value length
Tomas Krizek [Thu, 8 Apr 2021 10:57:33 +0000 (12:57 +0200)]
daemon/worker: add doh_headers_in list
Tomas Krizek [Wed, 7 Apr 2021 14:04:02 +0000 (16:04 +0200)]
doc/net.tls(): update command example output
Technically, we return an actual lua table instead of this
pretty-printed representation, but I chose it to be consistent with the
rest of the docs.
Tomas Krizek [Mon, 5 Apr 2021 17:26:40 +0000 (19:26 +0200)]
daemon/http: expose HTTP headers to kr_request
Add HTTP headers to an optional kr_request.qsource.headers structure.
Headers are stored as name, value string pairs.
The following snippet can be used to access the headers in lua modules:
```
if (req.qsource.headers ~= nil) then
for i = 1, tonumber(req.qsource.headers.len) do
local name = ffi.string(req.qsource.headers.at[i - 1].name)
local value = ffi.string(req.qsource.headers.at[i - 1].value)
print(name, value)
end
end
```
Fixes #616
Tomas Krizek [Mon, 5 Apr 2021 15:12:40 +0000 (17:12 +0200)]
daemon/http: use struct for http stream
Tomas Krizek [Mon, 17 May 2021 09:26:37 +0000 (09:26 +0000)]
Merge branch 'trust-anchors' into 'master'
trust anchor improvements
Closes #673
See merge request knot/knot-resolver!1177
Vladimír Čunát [Sat, 15 May 2021 11:33:40 +0000 (13:33 +0200)]
lib/dnssec/ta: remove trivial kr_ta_covers_qry()
Vladimír Čunát [Thu, 6 May 2021 16:35:04 +0000 (18:35 +0200)]
lib/resolve: minor improvements around kr_ta_* calls
This orphaned kr_ta_get_longest_name() so it got removed as well,
even though it's a potentially useful abstraction.
Vladimír Čunát [Thu, 6 May 2021 13:31:11 +0000 (15:31 +0200)]
lib/dnssec/ta: remove unused kr_ta_covers() function
It was word-for-word identical with kr_ta_get_longest_name() anyway,
except for additional pointer->bool conversion.
Vladimír Čunát [Thu, 6 May 2021 16:19:46 +0000 (18:19 +0200)]
lib/dnssec/ta kr_ta_covers_qry(): generalize and improve
The closer (N)TA will win now. That wasn't the case
if we had a positive TA underneath a negative TA.
(Well, I can't recall ever seeing anything close to a use case.)
Vladimír Čunát [Thu, 6 May 2021 15:45:51 +0000 (17:45 +0200)]
validator: improve NTA precision
Tomas Krizek [Wed, 5 May 2021 10:45:52 +0000 (10:45 +0000)]
Merge branch 'ci-tags' into 'master'
ci: skip pipeline tests on tags
See merge request knot/knot-resolver!1176
Tomas Krizek [Wed, 5 May 2021 09:59:49 +0000 (11:59 +0200)]
ci: skip pipeline tests on tags
When releasing, checks are run before merging and tagging. Having these
checks run again only slows down the release process, especially if some
tests are flaky.
Tomas Krizek [Wed, 5 May 2021 09:23:24 +0000 (09:23 +0000)]
Merge branch 'release-5-3-2' into 'master'
release 5.3.2
See merge request knot/knot-resolver!1175
Tomas Krizek [Wed, 5 May 2021 08:31:50 +0000 (10:31 +0200)]
release 5.3.2