bind9/lib/ns
Ondřej Surý 36897a0872 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
(cherry picked from commit c62f24f7ee)
2026-04-30 07:38:57 +02:00
..
include Use clang-format-22 to update formatting 2026-03-04 12:18:27 +01:00
.gitignore Add support for User Statically Defined Tracing (USDT) probes 2023-08-21 18:39:53 +02:00
client.c Return FORMERR for ECS family 0 2026-02-19 22:42:26 +11:00
hooks.c standardize CHECK and RETERR macros 2025-12-03 19:17:20 -08:00
interfacemgr.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
listenlist.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
log.c Log the rcode returned to for a query 2024-09-30 00:10:47 +00:00
Makefile.am Add support for User Statically Defined Tracing (USDT) probes 2023-08-21 18:39:53 +02:00
notify.c convert TSIG keyring storage from RBT to hash table 2023-06-14 08:14:38 +00:00
probes.d Add a probe when the response rate limiting drops or slips query 2023-08-21 18:39:53 +02:00
query.c Fix swapped arguments in redirect2() single-label branch 2026-04-30 07:38:57 +02:00
server.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
sortlist.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
stats.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +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 19:24:13 +02:00
xfrout.c Log serial when IXFR version not in journal 2025-12-10 15:25:23 +00:00