]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
iterate: fix DNS64 on CNAMEs
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 25 May 2026 09:29:46 +0000 (11:29 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 15 Jul 2026 14:39:32 +0000 (16:39 +0200)
It's a bit embarassing that the issue has lasted this long.
Overall the DNS64 module is slightly hacky/prototype-ish.

NEWS
lib/layer/iterate.c
modules/dns64/dns64.lua

diff --git a/NEWS b/NEWS
index 48cbe974a223ab8fa03a71a957b91cf076b5202f..bb58791c8c46602b3b7a7b46fbb82da3093f1f0b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ Bugfixes
 - respect disablement of QNAME case randomization even after TCP issues
 - cache: fix wrong TTL in some cases, typically 32768
 - reduce excessive caching of some uncommon failed answers (!1832)
+- dns64: fix CNAME problems again (#797, !1862)
 
 
 Knot Resolver 5.7.6 (2025-07-17)
index 688f13cfe2c28b54b85dda2ce52ee6211741f9a2..e4dfcd692bd8393b3fd9bafb592bb31d652b99d7 100644 (file)
@@ -801,6 +801,7 @@ static int process_answer(knot_pkt_t *pkt, struct kr_request *req)
                /* Copy transitive flags from original query to CNAME followup. */
                next->flags.TRACE = query->flags.TRACE;
                next->flags.ALWAYS_CUT = query->flags.ALWAYS_CUT;
+               next->flags.DNS64_MARK = query->flags.DNS64_MARK;
 
                /* Original query might have turned minimization off, revert. */
                next->flags.NO_MINIMIZE = req->options.NO_MINIMIZE;
index b4fb1ecb7d1d78f6fbd40a9f19bac4e4b3f552b9..b9382422210850443fbc9bd177bfeb0b93d7439c 100644 (file)
@@ -150,6 +150,10 @@ function M.layer.consume(state, req, pkt)
                                qry.uid,
                                req.pool)
                end
+               -- Also mark CNAMEs to be included.
+               if orig.qry_uid == qry.uid and orig.rr.type == kres.type.CNAME then
+                       orig.to_wire = true
+               end
        end
        ffi.C.kr_ranked_rrarray_finalize(req.answ_selected, qry.uid, req.pool)
        req:set_extended_error(kres.extended_error.FORGED, "BHD4: DNS64 synthesis")