From: Vladimír Čunát Date: Mon, 25 May 2026 09:29:46 +0000 (+0200) Subject: iterate: fix DNS64 on CNAMEs X-Git-Tag: v5.7.7~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3e987c5dc3537fe0db071e98af46fc2e39aff08;p=thirdparty%2Fknot-resolver.git iterate: fix DNS64 on CNAMEs It's a bit embarassing that the issue has lasted this long. Overall the DNS64 module is slightly hacky/prototype-ish. --- diff --git a/NEWS b/NEWS index 48cbe974a..bb58791c8 100644 --- 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) diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index 688f13cfe..e4dfcd692 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -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; diff --git a/modules/dns64/dns64.lua b/modules/dns64/dns64.lua index b4fb1ecb7..b93824222 100644 --- a/modules/dns64/dns64.lua +++ b/modules/dns64/dns64.lua @@ -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")