Tore Anderson [Mon, 27 Jul 2026 08:31:11 +0000 (10:31 +0200)]
tests: cover device keying in conn_pool and the unreachable cache
Neither had a test that would catch a broken device comparison -- only
the mechanical signature updates from wiring 'dev' through. Add
contrib/test_conn_pool exercising conn_pool_get()/put() with distinct
devices for the same address pair, and extend test_unreachable with an
equivalent case.
Verified each new assertion actually fails when the corresponding
strcmp(dev, ...) check is removed, and passes again once restored.
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Tore Anderson [Mon, 27 Jul 2026 07:31:00 +0000 (09:31 +0200)]
tests: cover conf_remote_t via_dev parsing
Exercises the case that motivated resetting via_dev between candidates
in conf_remote_txn(): a remote whose second address matches a 'via'
without a device after a first address matched one with a device.
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Tore Anderson [Mon, 27 Jul 2026 07:19:17 +0000 (09:19 +0200)]
requestor: key the unreachable-remote cache on the outgoing device too
knot_unreachable_is()/knot_unreachable_add() were keyed on remote+via
address only. A connection failure scoped to one 'via' device could
therefore mark a remote unreachable for a different request to the
same address using a different device.
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Tore Anderson [Mon, 27 Jul 2026 07:46:08 +0000 (09:46 +0200)]
net: key the TCP connection pool on the outgoing device too
The pool was keyed on source/destination address only, so a pooled
connection could be handed to a request wanting a different 'via'
device even with identical addresses. Key on the bound device as well,
and thread it through requestor.c, tls-requestor.c, quic-requestor.c,
and hiredis.c (the latter two pass NULL, having no device concept).
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Tore Anderson [Mon, 27 Jul 2026 07:45:54 +0000 (09:45 +0200)]
remote: bind outgoing connections to a device via 'via' address
The 'via' remote source address already accepted the '%interface'
wildcard-binding syntax used by 'listen', but the parsed device name
was discarded and never reached the outgoing socket. Thread it through
conf_remote_t -> knot_request_t -> net_connected_socket() so
SO_BINDTODEVICE is applied to sockets used for NOTIFY, AXFR/IXFR, and
other outgoing requests, not just listening sockets.
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Daniel Salzman [Sat, 4 Jul 2026 18:40:52 +0000 (20:40 +0200)]
libknot/db: add workaround for mdb_drop() version 1.0.0 in lmdb.clear()
This fixes compatibility with LMDB 1.0.0, where mdb_drop() cannot be followed
by further additions within the same transaction. Otherwise, mdb_commit() fails
with "MDB_BAD_TXN: Transaction must abort, has a child, or is invalid".
Lukáš Ondráček [Tue, 9 Jun 2026 14:17:56 +0000 (16:17 +0200)]
contrib/ucw/mempool: include chunk metadata in requested size
Originally, the requested chunk size was enlarged by the size of its metadata (~16 B)
and then in mmap version of mempools it was rounded up to the page size.
As the requested size itself is usually rounded to whole pages,
the chunk size was roughly by one page larger than expected;
still the whole space could have been used by mempools.
In non-mmap version (not used here), the effect might have been even worse,
as the rounding may be involved on the allocator level
and so the excessive memory cannot be used by mempools.
Now, usable size of chunks is a little smaller than requested,
but allocated area size corresponds to what was requested.
Lukáš Ondráček [Tue, 2 Jun 2026 16:03:51 +0000 (18:03 +0200)]
contrib/ucw/mempool: extend mp_stats with used_size
It was introduced in a newer upstream version
and can be useful for calculating mempool overhead
as (total_size - used_size);
though it's not currently used even in kres.
vendemiat [Mon, 29 Jun 2026 23:45:14 +0000 (16:45 -0700)]
quic: close connection on TLS handshake failure
Close connection on NGTCP2_ERR_CRYPTO from ngtcp2_conn_read_pkt) instead
of silently discarding the packet.
Fixes timeout issues for clients failing TLS handshake (for e.g. ALPN
mismatch or certificate algorithm mismatch)