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);
/* 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) */
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. */
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