From b886b349af5bac1e82d05ce50a097e4ab397fd6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= <vladimir.cunat@nic.cz>
Date: Wed, 11 Sep 2019 17:22:59 +0200
Subject: [PATCH] compatible changes around kr_request::answer

---
 lib/resolve.c           | 4 ++--
 lib/rplan.h             | 2 +-
 modules/dns64/dns64.lua | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/resolve.c b/lib/resolve.c
index fb53b6198..44fbef588 100644
--- a/lib/resolve.c
+++ b/lib/resolve.c
@@ -420,7 +420,7 @@ static int edns_erase_and_reserve(knot_pkt_t *pkt)
 	return knot_pkt_reserve(pkt, len);
 }
 
-static int edns_create(knot_pkt_t *pkt, knot_pkt_t *template, struct kr_request *req)
+static int edns_create(knot_pkt_t *pkt, const struct kr_request *req)
 {
 	pkt->opt_rr = knot_rrset_copy(req->ctx->upstream_opt_rr, &pkt->mm);
 	size_t wire_size = knot_edns_wire_size(pkt->opt_rr);
@@ -704,7 +704,7 @@ static int query_finalize(struct kr_request *request, struct kr_query *qry, knot
 	/* Remove any EDNS records from any previous iteration. */
 	int ret = edns_erase_and_reserve(pkt);
 	if (ret) return ret;
-	ret = edns_create(pkt, request->answer, request);
+	ret = edns_create(pkt, request);
 	if (ret) return ret;
 	if (qry->flags.STUB) {
 		/* Stub resolution (ask for +rd and +do) */
diff --git a/lib/rplan.h b/lib/rplan.h
index 7575ecd5b..e69a3f86c 100644
--- a/lib/rplan.h
+++ b/lib/rplan.h
@@ -30,7 +30,7 @@ struct kr_qflags {
 	bool EXPIRING : 1;       /**< Query response is cached, but expiring. */
 	bool ALLOW_LOCAL : 1;    /**< Allow queries to local or private address ranges. */
 	bool DNSSEC_WANT : 1;    /**< Want DNSSEC secured answer; exception: +cd,
-				  * i.e. knot_wire_set_cd(request->answer->wire). */
+				  * i.e. knot_wire_get_cd(request->qsource.packet->wire) */
 	bool DNSSEC_BOGUS : 1;   /**< Query response is DNSSEC bogus. */
 	bool DNSSEC_INSECURE : 1;/**< Query response is DNSSEC insecure. */
 	bool DNSSEC_CD : 1;      /**< Instruction to set CD bit in request. */
diff --git a/modules/dns64/dns64.lua b/modules/dns64/dns64.lua
index 0628a5040..a389b7837 100644
--- a/modules/dns64/dns64.lua
+++ b/modules/dns64/dns64.lua
@@ -31,7 +31,7 @@ function M.layer.consume(state, req, pkt)
 	local qry = req:current()
 	-- Observe only final answers in IN class where request has no CD flag.
 	if M.proxy == nil or not qry.flags.RESOLVED
-			or pkt:qclass() ~= kres.class.IN or req.answer:cd() then
+			or pkt:qclass() ~= kres.class.IN or req.qsource.packet:cd() then
 		return state
 	end
 	-- Synthetic AAAA from marked A responses
-- 
GitLab