Commit 3f950e1d authored by Daniel Salzman's avatar Daniel Salzman

process_query: don't preserve CD flag

parent 809bb50a
......@@ -321,6 +321,7 @@ static int prepare_answer(const knot_pkt_t *query, knot_pkt_t *resp, knot_layer_
if (ret != KNOT_EOK) {
return ret;
}
knot_wire_clear_cd(resp->wire); // TODO: should be inside knot_pkt_init_response.
/* Query MUST carry a question. */
const knot_dname_t *qname = knot_pkt_qname(query);
......@@ -401,6 +402,7 @@ static int process_query_err(knot_layer_t *ctx, knot_pkt_t *pkt)
/* Initialize response from query packet. */
knot_pkt_t *query = qdata->query;
knot_pkt_init_response(pkt, query);
knot_wire_clear_cd(pkt->wire); // TODO: should be inside knot_pkt_init_response.
/* Restore original QNAME. */
process_query_qname_case_restore(qdata, pkt);
......
......@@ -23,10 +23,10 @@ resp = knot.dig("flags", "NS", flags="RD")
resp.check(flags="QR AA RD", noflags="TC RA AD CD Z")
resp.cmp(bind)
# CD flag preservation.
# CD flag must be cleared (RFC 4035, Section 3.1.6).
resp = knot.dig("flags", "NS", flags="CD")
resp.check(flags="QR AA CD", noflags="TC RA AD RD Z")
resp.cmp(bind)
resp.check(flags="QR AA", noflags="TC RA AD RD CD Z")
# Bind preserves CD flag
# TC flag must be cleared
resp = knot.dig("flags", "NS", flags="TC")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment