bind9/lib/ns
Ondřej Surý c62f24f7ee Fix swapped arguments in redirect2() single-label branch
For a query whose qname is the root, the labels==1 branch in
redirect2() called dns_name_copy(redirectname, view->redirectzone)
with arguments reversed, overwriting the view-global
nxdomain-redirect target with the empty redirectname rather than
copying the configured target into the per-query lookup name.  After
the corruption, view->redirectzone names the root, so
dns_name_issubdomain() makes redirect2() short-circuit for every
subsequent query and the nxdomain-redirect feature stops working
until named is restarted.

Triggering this needs the resolver to receive an NXDOMAIN for the
root from upstream, which does not happen in normal DNS operation.

Swap the arguments to match the dns_name_copy(source, dest)
signature.  Add a system test that issues a root query through the
nxdomain-redirect resolver and verifies the redirect feature still
works for a normal NXDOMAIN-producing query afterwards.

Assisted-by: Claude:claude-opus-4-7
2026-04-29 21:46:27 +02:00
..
include Use delegation DB for bestzonecut lookups 2026-03-30 20:41:13 +02:00
.gitignore Add support for User Statically Defined Tracing (USDT) probes 2023-08-21 18:39:53 +02:00
client.c Move zone set/get properties to own source file 2026-04-02 15:50:07 +02:00
hooks.c use a standard CLEANUP macro 2025-12-03 13:45:43 -08:00
interfacemgr.c switch to RETERR where it wasn't being used 2025-12-03 13:45:43 -08:00
listenlist.c Use ControlStatementsExceptControlMacros for SpaceBeforeParens 2025-08-19 07:58:33 +02:00
meson.build Use unique names for probes.d files 2025-09-24 13:18:13 +02:00
notify.c Move zone set/get properties to own source file 2026-04-02 15:50:07 +02:00
probes-ns.d Use unique names for probes.d files 2025-09-24 13:18:13 +02:00
query.c Fix swapped arguments in redirect2() single-label branch 2026-04-29 21:46:27 +02:00
server.c Add low contention stats counter 2026-03-26 10:19:25 +01:00
stats.c Add low contention stats counter 2026-03-26 10:19:25 +01:00
tests Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
update.c Refuse SIG and NXT records in dynamic updates 2026-04-17 16:09:39 +02:00
xfrout.c Move zone set/get properties to own source file 2026-04-02 15:50:07 +02:00