]> git.ipfire.org Git - thirdparty/knot-resolver.git/log
thirdparty/knot-resolver.git
4 years agofixup! wip: only switch to tcp on TC=1 remove_tcp_timeout_threshold
Štěpán Balážik [Thu, 18 Feb 2021 13:28:40 +0000 (14:28 +0100)] 
fixup! wip: only switch to tcp on TC=1

4 years agowip: only switch to tcp on TC=1
Štěpán Balážik [Wed, 17 Feb 2021 18:07:19 +0000 (19:07 +0100)] 
wip: only switch to tcp on TC=1

4 years agowip: remove TCP RTT threshold
Štěpán Balážik [Wed, 17 Feb 2021 17:07:53 +0000 (18:07 +0100)] 
wip: remove TCP RTT threshold

4 years agoMerge branch 'sendmmsg-logs' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1454 obs-knot-dns-deve-jq0xxt/deployments/1456 obs-knot-dns-deve-jq0xxt/deployments/1457 obs-knot-dns-deve-jq0xxt/deployments/1460 obs-knot-dns-deve-jq0xxt/deployments/1463 obs-knot-dns-deve-jq0xxt/deployments/1464 obs-knot-dns-deve-jq0xxt/deployments/1467 obs-knot-resolver-bs4hbr/deployments/1453 obs-knot-resolver-bs4hbr/deployments/1455 obs-knot-resolver-bs4hbr/deployments/1458 obs-knot-resolver-bs4hbr/deployments/1461 obs-knot-resolver-bs4hbr/deployments/1462 obs-knot-resolver-bs4hbr/deployments/1465 obs-knot-resolver-bs4hbr/deployments/1466
Tomas Krizek [Fri, 12 Feb 2021 12:03:41 +0000 (13:03 +0100)] 
Merge branch 'sendmmsg-logs' into 'master'

daemon/udp_queue: drop the error logging

See merge request knot/knot-resolver!1139

4 years agodaemon/udp_queue: drop the error logging
Vladimír Čunát [Fri, 12 Feb 2021 09:06:25 +0000 (10:06 +0100)] 
daemon/udp_queue: drop the error logging

We should do this for all transports and probably just in verbose mode.
We were printing lots of these on Turris OS (for one user at least):
https://forum.turris.cz/t/5-1-8-kresd-throwing-many-errors-in-var-log-messages/14775

EACCESS in particular apparently may happen (on Linux) when the network
is "unavailable", EPERM because of firewall/netfilter:
https://stackoverflow.com/a/23869102

4 years agoMerge !1137: bump required Knot DNS version to 2.9
Vladimír Čunát [Fri, 12 Feb 2021 10:03:10 +0000 (11:03 +0100)] 
Merge !1137: bump required Knot DNS version to 2.9

4 years agobump required Knot DNS version to 2.9
Tomas Krizek [Wed, 10 Feb 2021 15:01:17 +0000 (16:01 +0100)] 
bump required Knot DNS version to 2.9

4 years agoMerge branch 'http-trace-stability' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1451 obs-knot-resolver-bs4hbr/deployments/1450
Tomas Krizek [Thu, 11 Feb 2021 10:25:43 +0000 (11:25 +0100)] 
Merge branch 'http-trace-stability' into 'master'

modules/{http,watchdog}: fix stability problems

See merge request knot/knot-resolver!1136

4 years agomodules/{http,watchdog}: fix stability problems
Vladimír Čunát [Wed, 10 Feb 2021 11:56:14 +0000 (12:56 +0100)] 
modules/{http,watchdog}: fix stability problems

As first noted in commit d1a229ae9, in some cases we do call chains that
are not supported for JIT in LuaJIT.

I'm not 100% sure all of these are needed to comply, but the functions
here are really small and probably not to be that heavily used,
so I don't think it will be costly to interpret them
(and avoiding crashes is more important).

In my tests this fixed occasional crashes when using http://*/trace/*

4 years agoMerge branch 'knot-3.1' into 'master'
Tomas Krizek [Thu, 11 Feb 2021 09:59:17 +0000 (10:59 +0100)] 
Merge branch 'knot-3.1' into 'master'

adapt to knot 3.1 changes

See merge request knot/knot-resolver!1134

4 years agoadapt to libknot 3.1 API changes in XDP
Vladimír Čunát [Tue, 22 Dec 2020 08:07:27 +0000 (09:07 +0100)] 
adapt to libknot 3.1 API changes in XDP

4 years agoMerge branch 'sonarcloud-fixup' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1445 obs-knot-dns-deve-jq0xxt/deployments/1447 obs-knot-resolver-bs4hbr/deployments/1446 obs-knot-resolver-bs4hbr/deployments/1448
Tomas Krizek [Tue, 9 Feb 2021 16:33:00 +0000 (17:33 +0100)] 
Merge branch 'sonarcloud-fixup' into 'master'

ci: Sonarcloud fixup

See merge request knot/knot-resolver!1135

4 years agoci: fix .gitlabci sonarcloud line folding
Tomas Krizek [Tue, 9 Feb 2021 16:13:19 +0000 (17:13 +0100)] 
ci: fix .gitlabci sonarcloud line folding

4 years agoMerge branch 'sonarcloud' into 'master'
Tomas Krizek [Tue, 9 Feb 2021 13:04:04 +0000 (14:04 +0100)] 
Merge branch 'sonarcloud' into 'master'

ci: sonarcloud improvements

See merge request knot/knot-resolver!1121

4 years agoci sonarcloud: add project version (git describe)
Vladimír Čunát [Thu, 7 Jan 2021 11:23:39 +0000 (12:23 +0100)] 
ci sonarcloud: add project version (git describe)

and break the overlong line

4 years agoMerge branch 'policy.ANSWER' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1443 obs-knot-resolver-bs4hbr/deployments/1444
Tomas Krizek [Mon, 8 Feb 2021 15:41:43 +0000 (16:41 +0100)] 
Merge branch 'policy.ANSWER' into 'master'

policy.ANSWER: minor fixes, mainly around NODATA answers

See merge request knot/knot-resolver!1129

4 years agodoc: fix a tiny typo
Vladimír Čunát [Mon, 8 Feb 2021 13:34:05 +0000 (14:34 +0100)] 
doc: fix a tiny typo

Reported on:
https://gitter.im/CZ-NIC/knot-resolver?at=60213c720eed905f189da4d7

4 years agopolicy.ANSWER: minor fixes, mainly around NODATA answers
Vladimír Čunát [Thu, 28 Jan 2021 10:37:05 +0000 (11:37 +0100)] 
policy.ANSWER: minor fixes, mainly around NODATA answers

- return SOA in NODATA answers and allow customizing it
- only call ensure_answer() if really generating an answer
  (otherwise we might e.g. deplete XDP buffers, in extreme cases)

4 years agoMerge !1133: packaging: link to Arch Linux package
Vladimír Čunát [Mon, 8 Feb 2021 08:55:51 +0000 (09:55 +0100)] 
Merge !1133: packaging: link to Arch Linux package

4 years agopackaging: link to Arch Linux package
Tomas Krizek [Fri, 5 Feb 2021 17:22:31 +0000 (18:22 +0100)] 
packaging: link to Arch Linux package

Arch Linux now ships knot-resolver in their repositories, delete
reference to AUR.

Thanks to daurnimator who adopted the package!

4 years agoMerge branch 'modules-docs' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1436 obs-knot-dns-deve-jq0xxt/deployments/1437 obs-knot-dns-deve-jq0xxt/deployments/1439 obs-knot-dns-deve-jq0xxt/deployments/1441 obs-knot-resolver-bs4hbr/deployments/1435 obs-knot-resolver-bs4hbr/deployments/1438 obs-knot-resolver-bs4hbr/deployments/1440 obs-knot-resolver-bs4hbr/deployments/1442
Tomas Krizek [Thu, 4 Feb 2021 14:24:41 +0000 (15:24 +0100)] 
Merge branch 'modules-docs' into 'master'

minor module docs fixes

See merge request knot/knot-resolver!1131

4 years agomodules/stats: fix README mistake in .set()
Vladimír Čunát [Thu, 4 Feb 2021 09:37:42 +0000 (10:37 +0100)] 
modules/stats: fix README mistake in .set()

Reported on:
https://gitter.im/CZ-NIC/knot-resolver?at=601ae90e9fa6765ef8f6b408

4 years agomodules/prefill: fix README typo
Vladimír Čunát [Thu, 4 Feb 2021 09:08:29 +0000 (10:08 +0100)] 
modules/prefill: fix README typo

(and regularize indentation)  Reported on:
https://gitter.im/CZ-NIC/knot-resolver?at=601b36f6aa6a6f319d0235f5

4 years agoMerge !1130: when FORMERR comes, differentiate based on OPT obs-knot-dns-deve-jq0xxt/deployments/1431 obs-knot-dns-deve-jq0xxt/deployments/1434 obs-knot-resolver-bs4hbr/deployments/1432 obs-knot-resolver-bs4hbr/deployments/1433
Vladimír Čunát [Tue, 2 Feb 2021 19:15:09 +0000 (20:15 +0100)] 
Merge !1130: when FORMERR comes, differentiate based on OPT

4 years agowhen FORMERR comes, differentiate based on OPT
Vladimír Čunát [Mon, 1 Feb 2021 09:09:16 +0000 (10:09 +0100)] 
when FORMERR comes, differentiate based on OPT

In particular, non-support of EDNS is implied iff FORMERR without OPT
comes.  If OPT is there, one possibility is that there was something
wrong in the OPT that *we* sent, but it seems much more likely that
this particular server is just bad and we want to try another one.
https://tools.ietf.org/html/rfc6891#section-7
In particular, we would be in trouble if we dropped OPT in a zone
that is covered by DNSSEC.

4 years agolib/selection: rename to *_FORMERR for consistency
Vladimír Čunát [Mon, 1 Feb 2021 08:57:46 +0000 (09:57 +0100)] 
lib/selection: rename to *_FORMERR for consistency

It's now consistent with KNOT_RCODE_FORMERR and the official name
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6

4 years agoMerge !1128: remove NO_THROTTLE option obs-knot-dns-deve-jq0xxt/deployments/1421 obs-knot-dns-deve-jq0xxt/deployments/1424 obs-knot-dns-deve-jq0xxt/deployments/1425 obs-knot-dns-deve-jq0xxt/deployments/1428 obs-knot-dns-deve-jq0xxt/deployments/1429 obs-knot-resolver-bs4hbr/deployments/1422 obs-knot-resolver-bs4hbr/deployments/1423 obs-knot-resolver-bs4hbr/deployments/1426 obs-knot-resolver-bs4hbr/deployments/1427 obs-knot-resolver-bs4hbr/deployments/1430
Vladimír Čunát [Thu, 28 Jan 2021 14:38:56 +0000 (15:38 +0100)] 
Merge !1128: remove NO_THROTTLE option

4 years agoremove NO_THROTTLE option
Štěpán Balážik [Wed, 20 Jan 2021 11:48:45 +0000 (12:48 +0100)] 
remove NO_THROTTLE option

It wasn't really used for a long time and became completely obsolete after
!1030.

4 years agoMerge branch 'remove-safemode' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1420 obs-knot-resolver-bs4hbr/deployments/1419
Štěpán Balážik [Wed, 27 Jan 2021 11:25:55 +0000 (12:25 +0100)] 
Merge branch 'remove-safemode' into 'master'

Rework iterate.c/selection.c error handling

Closes #640

See merge request knot/knot-resolver!1126

4 years agomention MR in NEWS
Štěpán Balážik [Wed, 27 Jan 2021 11:23:48 +0000 (12:23 +0100)] 
mention MR in NEWS

4 years agolib/selection: refactor kr_selection_error_str()
Vladimír Čunát [Tue, 26 Jan 2021 11:25:09 +0000 (12:25 +0100)] 
lib/selection: refactor kr_selection_error_str()

This way leaves less room for mistakes, etc.  It's just the idea from:
https://gitlab.nic.cz/knot/knot-resolver/-/commit/dd0c99bdb6332ba3628833a8543a5f9f33141ddd#note_191580

4 years agoiterate.c: clarify is_authoritative workaround comment 75416
Štěpán Balážik [Mon, 25 Jan 2021 08:48:57 +0000 (09:48 +0100)] 
iterate.c: clarify is_authoritative workaround comment

4 years agoselection: only report RTT if there is an answer
Štěpán Balážik [Fri, 22 Jan 2021 18:22:20 +0000 (19:22 +0100)] 
selection: only report RTT if there is an answer

Previously this would pollute the RTT cache with non-sensical
measurements from unsuccessful TCP connects for example.

4 years agomodules/rebinding: fix module logging to new server selection
Štěpán Balážik [Mon, 25 Jan 2021 09:40:13 +0000 (10:40 +0100)] 
modules/rebinding: fix module logging to new server selection

Module would crash due to the change of `request->upstream`
structure.

4 years agoselection_iter: relax NSNXAttack mitigation
Štěpán Balážik [Wed, 20 Jan 2021 18:33:14 +0000 (19:33 +0100)] 
selection_iter: relax NSNXAttack mitigation

Previously the mitigation would stop some longer benign resolutions.
We can safely zero the subquery counter when choose a concrete transport
for the query (i.e. NS name with known IP address).

4 years agoselection: force resolution of new NS name after lame delegation
Štěpán Balážik [Wed, 20 Jan 2021 15:19:18 +0000 (16:19 +0100)] 
selection: force resolution of new NS name after lame delegation

Lame delegations are weird, they breed more lame delegations on broken
zones since trying another server from the same set usualy doesn't help.
We force resolution of another NS name in hope of getting somewhere.

4 years agoiterate: interpret empty FORMERR answers correctly
Štěpán Balážik [Wed, 20 Jan 2021 10:12:12 +0000 (11:12 +0100)] 
iterate: interpret empty FORMERR answers correctly

Previously a 12B reply with FORMERR would be treated as malformed
creating a need for a workaround (switching off EDNS for every malformed
answer).

4 years agobogus_log: fix bogus_log test to new error handling
Štěpán Balážik [Tue, 19 Jan 2021 16:03:51 +0000 (17:03 +0100)] 
bogus_log: fix bogus_log test to new error handling

4 years agoresolve.c: trigger serve stale on NSNXAttack mitigation from kr_resolve_consume
Štěpán Balážik [Tue, 19 Jan 2021 15:08:22 +0000 (16:08 +0100)] 
resolve.c: trigger serve stale on NSNXAttack mitigation from kr_resolve_consume

4 years agoiterate.c: don't copy NO_MINIMIZE when following a CNAME
Štěpán Balážik [Tue, 19 Jan 2021 12:39:04 +0000 (13:39 +0100)] 
iterate.c: don't copy NO_MINIMIZE when following a CNAME

Instead copy it from the request's options.

Reasoning: Minimization might have been turned off as a workaround for
broken authoritative servers which doesn't support it. There is no
reason to drop minimization when switching zones when following a CNAME.

4 years agoselection: fix DNSSEC_BOGUS/NSNXAttack mitigation interaction
Štěpán Balážik [Thu, 14 Jan 2021 23:49:38 +0000 (00:49 +0100)] 
selection: fix DNSSEC_BOGUS/NSNXAttack mitigation interaction

When cancelling a query due to NSNXAttack mitigation when validator was
also in BOGUS state, records wouldn't be stripped from the answer.

4 years agoselection: better error messages for errors
Štěpán Balážik [Thu, 14 Jan 2021 19:09:38 +0000 (20:09 +0100)] 
selection: better error messages for errors

4 years agoselection: minor fixes in commented code
Štěpán Balážik [Thu, 14 Jan 2021 17:32:43 +0000 (18:32 +0100)] 
selection: minor fixes in commented code

These will become useful once we actually use it…

4 years agoiterate: rework error handling from iterate.c
Štěpán Balážik [Thu, 14 Jan 2021 14:39:31 +0000 (15:39 +0100)] 
iterate: rework error handling from iterate.c

Previously there where resolve_badmsg and resolve_error functions used
to apply workarounds. This is now moved to selection.c and iterate.c
just provides feedback using the server selection API. Errors are now
handled centrally in selection.c:error.

4 years agoMerge branch 'ci-scan-build' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1401 obs-knot-dns-deve-jq0xxt/deployments/1403 obs-knot-dns-deve-jq0xxt/deployments/1405 obs-knot-dns-deve-jq0xxt/deployments/1408 obs-knot-dns-deve-jq0xxt/deployments/1409 obs-knot-dns-deve-jq0xxt/deployments/1411 obs-knot-dns-deve-jq0xxt/deployments/1413 obs-knot-dns-deve-jq0xxt/deployments/1416 obs-knot-dns-deve-jq0xxt/deployments/1418 obs-knot-resolver-bs4hbr/deployments/1402 obs-knot-resolver-bs4hbr/deployments/1404 obs-knot-resolver-bs4hbr/deployments/1406 obs-knot-resolver-bs4hbr/deployments/1407 obs-knot-resolver-bs4hbr/deployments/1410 obs-knot-resolver-bs4hbr/deployments/1412 obs-knot-resolver-bs4hbr/deployments/1414 obs-knot-resolver-bs4hbr/deployments/1415 obs-knot-resolver-bs4hbr/deployments/1417
Tomas Krizek [Mon, 18 Jan 2021 09:52:18 +0000 (10:52 +0100)] 
Merge branch 'ci-scan-build' into 'master'

ci lint:scan-build: work around changes in meson

See merge request knot/knot-resolver!1127

4 years agoci lint:scan-build: work around changes in meson
Vladimír Čunát [Mon, 18 Jan 2021 08:16:52 +0000 (09:16 +0100)] 
ci lint:scan-build: work around changes in meson

In 1f7678ea24 meson was updated and that broke our scan-build.
Now we work around that.  Quick analysis of why:
https://github.com/mesonbuild/meson/pull/5918#issuecomment-762064902

4 years agoMerge branch 'dnstap-tests' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1396 obs-knot-dns-deve-jq0xxt/deployments/1398 obs-knot-dns-deve-jq0xxt/deployments/1400 obs-knot-resolver-bs4hbr/deployments/1395 obs-knot-resolver-bs4hbr/deployments/1397 obs-knot-resolver-bs4hbr/deployments/1399
Tomas Krizek [Fri, 15 Jan 2021 14:22:31 +0000 (15:22 +0100)] 
Merge branch 'dnstap-tests' into 'master'

dnstap tests: integrate into meson, CI, etc.

See merge request knot/knot-resolver!1123

4 years agomeson: utilize test priority with sufficiently new meson 74870
Vladimír Čunát [Fri, 15 Jan 2021 13:45:40 +0000 (14:45 +0100)] 
meson: utilize test priority with sufficiently new meson

+ it's more efficient to schedule longer tests before shorter tests
- we get a warning (if meson is new enough to use priorities)

Priority numbers: I took the config tests as baseline.
I didn't touch tests with "is_parallel: false".

4 years agotests/dnstap: fix, refactor and integrate into meson and CI
Vladimír Čunát [Tue, 5 Jan 2021 15:59:48 +0000 (16:59 +0100)] 
tests/dnstap: fix, refactor and integrate into meson and CI

They need one go package which I can't find even in Debian,
so it probably can't work without network access.
The new dnstap in extra_tests runs if dnstap is built and go is found.
It also tries to keep the source tree clean.

Now both query and reply messages are tested.

In CI (after caching go deps in image) this tests only takes slightly
more time than the longest config.* tests, so that seems OK.
Even so, it's not added into the valgrind variant, as compilation
of the test still isn't split away from the run itself.

4 years agoci/debian-buster: add deps for dnstap in kresd
Vladimír Čunát [Tue, 5 Jan 2021 11:15:04 +0000 (12:15 +0100)] 
ci/debian-buster: add deps for dnstap in kresd

From distro packages, just libprotobuf-c-dev and golang-any are new,
but I also broke the overlong line and reorganized its contents a bit.

4 years agoMerge branch 'dnstap-pkg' into 'master'
Tomas Krizek [Fri, 15 Jan 2021 13:51:34 +0000 (14:51 +0100)] 
Merge branch 'dnstap-pkg' into 'master'

add dnstap subpackage

Closes #655

See merge request knot/knot-resolver!1118

4 years agodistro/tests: add dnstap test
Jakub Ružička [Wed, 6 Jan 2021 16:58:40 +0000 (17:58 +0100)] 
distro/tests: add dnstap test

4 years agodistro/rpm: add dnstap subpackage
Jakub Ružička [Tue, 5 Jan 2021 14:43:53 +0000 (15:43 +0100)] 
distro/rpm: add dnstap subpackage

introduce new dependencies:

* libfstrm
* libprotobuf-c

SUSE is missing protoc-c compiler so don't build dnstap there.

4 years agodistro/deb: add dnstap subpackage
Jakub Ružička [Tue, 5 Jan 2021 12:44:51 +0000 (13:44 +0100)] 
distro/deb: add dnstap subpackage

introduce new dependencies:

* libfstrm
* libprotobuf-c

4 years agodistro/deb: remove obsolete http module script
Jakub Ružička [Tue, 5 Jan 2021 16:47:06 +0000 (17:47 +0100)] 
distro/deb: remove obsolete http module script

This is a relic of ancient times.

4 years agoMerge branch 'no-assert-return-fix' into 'master'
Tomas Krizek [Fri, 15 Jan 2021 13:23:09 +0000 (14:23 +0100)] 
Merge branch 'no-assert-return-fix' into 'master'

selection: return early from forward_choose_transport with asserts off

See merge request knot/knot-resolver!1125

4 years agoselection: return early from forward_choose_transport with asserts off
Štěpán Balážik [Fri, 15 Jan 2021 11:52:02 +0000 (12:52 +0100)] 
selection: return early from forward_choose_transport with asserts off

This lead to unintitialized values being possibly used down the line.

4 years agoMerge branch 'reorder_rr-defaults' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1392 obs-knot-resolver-bs4hbr/deployments/1391
Tomas Krizek [Thu, 14 Jan 2021 16:38:18 +0000 (17:38 +0100)] 
Merge branch 'reorder_rr-defaults' into 'master'

randomize record order by default, i.e. reorder_RR(true)

See merge request knot/knot-resolver!1124

4 years agorandomize record order by default, i.e. reorder_RR(true)
Vladimír Čunát [Thu, 14 Jan 2021 12:16:06 +0000 (13:16 +0100)] 
randomize record order by default, i.e. reorder_RR(true)

It's quite cheap for us, and it might help with dumb clients
overusing the lowest IP from each set.

4 years agodaemon/engine: refactor repetitive naming in init_resolver()
Vladimír Čunát [Thu, 14 Jan 2021 11:51:39 +0000 (12:51 +0100)] 
daemon/engine: refactor repetitive naming in init_resolver()

"ctx" is the usual name elsewhere for a kr_context pointer

4 years agoMerge branch 'mempattern' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1387 obs-knot-resolver-bs4hbr/deployments/1388
Tomas Krizek [Wed, 13 Jan 2021 13:21:04 +0000 (14:21 +0100)] 
Merge branch 'mempattern' into 'master'

refactor memory allocation patterns a little

See merge request knot/knot-resolver!1115

4 years agotreewide: avoid memset where it's trivial obs-knot-resolver-bs4hbr/deployments/1380
Vladimír Čunát [Mon, 4 Jan 2021 09:50:18 +0000 (10:50 +0100)] 
treewide: avoid memset where it's trivial

More idiomatic code seems better:
- for variable initialization we have = { 0 }
- (mm_)calloc for heap allocations
  sizeof: use variable instead of type (where suitable; not sure why)

4 years agocontrib/mempattern: hide mm_malloc()
Vladimír Čunát [Wed, 23 Dec 2020 07:39:33 +0000 (08:39 +0100)] 
contrib/mempattern: hide mm_malloc()

Experience proved that it can be confused with mm_alloc()
and it may not be trivial to find the mistake.

4 years agomm_ctx_mempool2(): factor out the new function
Vladimír Čunát [Tue, 22 Dec 2020 13:11:31 +0000 (14:11 +0100)] 
mm_ctx_mempool2(): factor out the new function

4 years agoutilize mm_ctx_mempool() instead of writing by hand
Vladimír Čunát [Tue, 22 Dec 2020 13:10:38 +0000 (14:10 +0100)] 
utilize mm_ctx_mempool() instead of writing by hand

4 years agocontrib/mempattern: integrate other related functions
Vladimír Čunát [Tue, 22 Dec 2020 13:09:20 +0000 (14:09 +0100)] 
contrib/mempattern: integrate other related functions

4 years agocopy mempattern files from Knot DNS as they are
Vladimír Čunát [Tue, 22 Dec 2020 11:44:39 +0000 (12:44 +0100)] 
copy mempattern files from Knot DNS as they are

It seems just easier than having the copies in the current way.
I don't think the `static inline` were helping us anyway,
except for avoiding KR_EXPORT in some cases.

Still, differences when copying:
 - we use plain memset() in the implementation
   (no motivation here to use the complex memzero() approach)
 - we expose mm_malloc(), as we've been referring to it
 - we KR_EXPORT some of the functions (for lua and modules)

4 years agoMerge !1103: dnstap: log client requests + filter out internal queries
Vladimír Čunát [Wed, 13 Jan 2021 08:35:20 +0000 (09:35 +0100)] 
Merge !1103: dnstap: log client requests + filter out internal queries

4 years agodoc/upgrading: dnstap option log_responses moved
Tomas Krizek [Tue, 12 Jan 2021 11:45:17 +0000 (12:45 +0100)] 
doc/upgrading: dnstap option log_responses moved

4 years agofix trivial lint:tidy warnings
Vladimír Čunát [Fri, 8 Jan 2021 14:25:09 +0000 (15:25 +0100)] 
fix trivial lint:tidy warnings

These do not make the CI job fail, but better avoid them anyway.
I suspect they got added when we updated the CI docker image.

4 years agodnstap: represent DoT and DoH
Vladimír Čunát [Mon, 4 Jan 2021 15:28:52 +0000 (16:28 +0100)] 
dnstap: represent DoT and DoH

(instead of marking them as TCP)
This includes latest dnstap.proto, except for keeping our local changes
of the licensing comment.
https://github.com/dnstap/dnstap.pb/blob/master/dnstap.proto

4 years agotests/dnstap: Update configuration to match latest changes
Pavel Dolezal [Tue, 15 Dec 2020 14:24:11 +0000 (15:24 +0100)] 
tests/dnstap: Update configuration to match latest changes

4 years agodnstap: multiple changes
Pavel Dolezal [Tue, 15 Dec 2020 12:27:50 +0000 (13:27 +0100)] 
dnstap: multiple changes

- log queries and responses as separate dnstap messages
- use "query" instead of "request" to mirror dnstap specification
- don't export "query_zone" field in "CLIENT_*" messages

4 years agodnstap: Add optional identity and version fields
Pavel Dolezal [Mon, 14 Dec 2020 12:59:50 +0000 (13:59 +0100)] 
dnstap: Add optional identity and version fields

4 years agodnstap: optionally log client requests; don't log internal ones
Pavel Dolezal [Thu, 3 Dec 2020 09:04:53 +0000 (10:04 +0100)] 
dnstap: optionally log client requests; don't log internal ones

4 years agoMerge branch 'pkg-cznic-release' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1375 obs-knot-dns-deve-jq0xxt/deployments/1378 obs-knot-resolver-bs4hbr/deployments/1376 obs-knot-resolver-bs4hbr/deployments/1377
Tomas Krizek [Mon, 11 Jan 2021 16:03:59 +0000 (17:03 +0100)] 
Merge branch 'pkg-cznic-release' into 'master'

distro: introduce upstream cznic release prefix

See merge request knot/knot-resolver!1122

4 years agodistro: introduce upstream cznic release prefix
Jakub Ružička [Fri, 8 Jan 2021 16:23:17 +0000 (17:23 +0100)] 
distro: introduce upstream cznic release prefix

using cznic.1 release string for upstream packages ensures they are
prefered over downstream ones and that their versions don't collide
which was causing issues for users with both downstream and upstream
packaging repos enabled.

Following statements are true according to `dpkg --compare-versions`:

    1.2.3-1   < 1.2.3-cznic.1
    1.2.3-999 < 1.2.3-cznic.1

So upstream packages should always take precedence over downstream
packages of the same version.

4 years agoMerge branch 'link-local-forward' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1368 obs-knot-dns-deve-jq0xxt/deployments/1371 obs-knot-dns-deve-jq0xxt/deployments/1372 obs-knot-resolver-bs4hbr/deployments/1369 obs-knot-resolver-bs4hbr/deployments/1370 obs-knot-resolver-bs4hbr/deployments/1373
Štěpán Balážik [Fri, 8 Jan 2021 14:41:50 +0000 (15:41 +0100)] 
Merge branch 'link-local-forward' into 'master'

lib/selection: allow forwarding to link local address

See merge request knot/knot-resolver!1116

4 years agolib/selection: allow forwarding to link local address
Štěpán Balážik [Fri, 8 Jan 2021 14:41:50 +0000 (15:41 +0100)] 
lib/selection: allow forwarding to link local address

This is done by changing the type of address field in struct choice to
union inaddr and moving some conversion around.

4 years agoMerge branch 'doh2-memleak' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1366 obs-knot-resolver-bs4hbr/deployments/1365
Tomas Krizek [Thu, 7 Jan 2021 14:02:38 +0000 (15:02 +0100)] 
Merge branch 'doh2-memleak' into 'master'

daemon/http: fix memleak

See merge request knot/knot-resolver!1117

4 years agodaemon/http: use memmove() for session buffer write
Tomas Krizek [Thu, 7 Jan 2021 12:36:49 +0000 (13:36 +0100)] 
daemon/http: use memmove() for session buffer write

Since session buffer contains both the raw http data and the resulting
decoded DNS packet, memmove() should be used instead of memcpy().

4 years agodaemon/http: ensure uri_path is freed for POST
Tomas Krizek [Thu, 7 Jan 2021 12:35:21 +0000 (13:35 +0100)] 
daemon/http: ensure uri_path is freed for POST

Since #636 was implemented, uri_path is also saved for POST requests and
thus needs to be freed.

4 years agodaemon/http: fix memleak
Tomas Krizek [Tue, 5 Jan 2021 12:08:35 +0000 (13:08 +0100)] 
daemon/http: fix memleak

The http_data structure is allocated in http_write_pkt() and the last
callback that uses it is on_pkt_write(), so it should be responsible for
freeing the memory.

This used to leak a small amount of memory on every DoH response.

4 years agoMerge !1119: ci: add sonarcloud build
Vladimír Čunát [Thu, 7 Jan 2021 10:38:31 +0000 (11:38 +0100)] 
Merge !1119: ci: add sonarcloud build

4 years agoci: add sonarcloud build 74391 74404
Tomas Krizek [Tue, 5 Jan 2021 15:43:37 +0000 (16:43 +0100)] 
ci: add sonarcloud build

4 years agoMerge branch 'tumbleweed_errors' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1362 obs-knot-resolver-bs4hbr/deployments/1361
Tomas Krizek [Wed, 6 Jan 2021 14:25:22 +0000 (15:25 +0100)] 
Merge branch 'tumbleweed_errors' into 'master'

daemon/worker.c: fix warning from compilation without asserts

See merge request knot/knot-resolver!1120

4 years agodaemon/worker.c: fix warning from compilation without asserts
Štěpán Balážik [Wed, 6 Jan 2021 12:06:25 +0000 (13:06 +0100)] 
daemon/worker.c: fix warning from compilation without asserts

I kept the changes (especially the one in qr_task_on_send) as local as
possible while hopefully preserving the invariants other functions in
worker rely upon.

4 years agoMerge branch 'daf-clear' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1356 obs-knot-resolver-bs4hbr/deployments/1357
Tomas Krizek [Tue, 5 Jan 2021 09:28:02 +0000 (10:28 +0100)] 
Merge branch 'daf-clear' into 'master'

daf: Add clear method

See merge request knot/knot-resolver!1114

4 years agodaf: Add clear method
Vladimír Čunát [Wed, 30 Dec 2020 10:25:16 +0000 (11:25 +0100)] 
daf: Add clear method

Make it easier to delete all rules specified in daf.

4 years agoMerge !1110: docker: add dnstap support obs-knot-dns-deve-jq0xxt/deployments/1352 obs-knot-resolver-bs4hbr/deployments/1353
Vladimír Čunát [Mon, 4 Jan 2021 12:57:57 +0000 (13:57 +0100)] 
Merge !1110: docker: add dnstap support

4 years agodocker: add dnstap support
Tomas Krizek [Fri, 11 Dec 2020 11:26:32 +0000 (12:26 +0100)] 
docker: add dnstap support

4 years agoMerge !1030: server selection rewrite obs-knot-dns-deve-jq0xxt/deployments/1344 obs-knot-dns-deve-jq0xxt/deployments/1347 obs-knot-dns-deve-jq0xxt/deployments/1348 obs-knot-dns-deve-jq0xxt/deployments/1350 obs-knot-resolver-bs4hbr/deployments/1345 obs-knot-resolver-bs4hbr/deployments/1346 obs-knot-resolver-bs4hbr/deployments/1349 obs-knot-resolver-bs4hbr/deployments/1351
Vladimír Čunát [Thu, 31 Dec 2020 16:01:38 +0000 (17:01 +0100)] 
Merge !1030: server selection rewrite

Closes #447

4 years agoadd NEWS entry
Vladimír Čunát [Thu, 31 Dec 2020 14:54:31 +0000 (15:54 +0100)] 
add NEWS entry

4 years agolib/selection: minor refactorings and comments
Vladimír Čunát [Tue, 22 Dec 2020 10:29:39 +0000 (11:29 +0100)] 
lib/selection: minor refactorings and comments

Small things I've noticed while reading it all.
- line breaks: I believe <90 is OK, as usually the attempts to reduce
  lengths impair readability
- avoid unnecessary casts; usually the type was visible
  on the same line anyway
- avoid `|` on booleans
- one block gets de-indented (often badly shown in diffs)
- no need for UNRECOVERABLE_ERRORS in a header (and a weird one, too)
- recoverability from failed assertions (in case they're turned off)

4 years agolib/selection: tweak computation of RTT estimates
Vladimír Čunát [Tue, 29 Dec 2020 14:51:50 +0000 (15:51 +0100)] 
lib/selection: tweak computation of RTT estimates

- fix switched \alpha and \beta from the RFC (no big deal, I think)
- use the same order as in the RFC (perhaps that caused the switch?)
- avoid floating-point arithmetics (it's simple with these formulas)
- simplify the the backoff formula (MINs instead of branches)

4 years agolib/selection: refactor usage of bytes_to_ip()
Vladimír Čunát [Tue, 29 Dec 2020 09:17:13 +0000 (10:17 +0100)] 
lib/selection: refactor usage of bytes_to_ip()

4 years agolib/selection: be more careful around rtt_state.dead_since
Vladimír Čunát [Tue, 29 Dec 2020 08:28:16 +0000 (09:28 +0100)] 
lib/selection: be more careful around rtt_state.dead_since

It's all because the timestamp that we're using isn't (guaranteed to be)
meaningful across reboots or different machines, whereas our cache even
persists by default.

4 years agolib/selection: tweak how cache is used
Vladimír Čunát [Mon, 28 Dec 2020 09:09:18 +0000 (10:09 +0100)] 
lib/selection: tweak how cache is used

- standardize cache key choice and ensure impossibility of collisions
- comment on interaction with GC; it would be better to give RTT
  priority over most of other records
- be more robust wrt. value in cache

4 years agoselection: server selection rewrite
Štěpán Balážik [Fri, 20 Mar 2020 18:43:11 +0000 (19:43 +0100)] 
selection: server selection rewrite

Design discussion: #447
Code discussion: !1030

4 years agotests: fix knot-resolver specific Deckard tests
Štěpán Balážik [Mon, 26 Oct 2020 10:41:43 +0000 (11:41 +0100)] 
tests: fix knot-resolver specific Deckard tests