/* Stub resolution (ask for +rd and +do) */
if (qry->flags & QUERY_STUB) {
knot_wire_set_rd(pkt->wire);
- if (knot_pkt_has_dnssec(request->answer))
+ if (knot_pkt_has_dnssec(request->answer)) {
knot_edns_set_do(pkt->opt_rr);
+ }
+ if (knot_wire_get_cd(request->answer->wire)) {
+ knot_wire_set_cd(pkt->wire);
+ }
/* Full resolution (ask for +cd and +do) */
} else if (qry->flags & QUERY_DNSSEC_WANT) {
knot_edns_set_do(pkt->opt_rr);
{knot_wire_get_rd, "rd"},
{knot_wire_get_ra, "ra"},
{knot_wire_get_tc, "tc"},
- {knot_wire_get_cd, "cd"},
- {knot_wire_get_ad, "ad"}
+ {knot_wire_get_ad, "ad"},
+ {knot_wire_get_cd, "cd"}
};
for (int i = 0; i < 7; ++i) {
if (!flag[i].get(pkt->wire)) {
return;
}
offset += ret;
- maxlen -= offset;
+ maxlen -= ret;
}
dst[offset] = 0;
}