Commit 218f1b78 authored by Grigorii Demidov's avatar Grigorii Demidov

lib/resolve: forward +cd in stub mode; minor bugfix in debug output

parent 8d81ca01
...@@ -560,8 +560,12 @@ static int query_finalize(struct kr_request *request, struct kr_query *qry, knot ...@@ -560,8 +560,12 @@ static int query_finalize(struct kr_request *request, struct kr_query *qry, knot
/* Stub resolution (ask for +rd and +do) */ /* Stub resolution (ask for +rd and +do) */
if (qry->flags & QUERY_STUB) { if (qry->flags & QUERY_STUB) {
knot_wire_set_rd(pkt->wire); 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); 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) */ /* Full resolution (ask for +cd and +do) */
} else if (qry->flags & QUERY_DNSSEC_WANT) { } else if (qry->flags & QUERY_DNSSEC_WANT) {
knot_edns_set_do(pkt->opt_rr); knot_edns_set_do(pkt->opt_rr);
......
...@@ -582,8 +582,8 @@ static void flags_to_str(char *dst, const knot_pkt_t *pkt, size_t maxlen) ...@@ -582,8 +582,8 @@ static void flags_to_str(char *dst, const knot_pkt_t *pkt, size_t maxlen)
{knot_wire_get_rd, "rd"}, {knot_wire_get_rd, "rd"},
{knot_wire_get_ra, "ra"}, {knot_wire_get_ra, "ra"},
{knot_wire_get_tc, "tc"}, {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) { for (int i = 0; i < 7; ++i) {
if (!flag[i].get(pkt->wire)) { if (!flag[i].get(pkt->wire)) {
...@@ -595,7 +595,7 @@ static void flags_to_str(char *dst, const knot_pkt_t *pkt, size_t maxlen) ...@@ -595,7 +595,7 @@ static void flags_to_str(char *dst, const knot_pkt_t *pkt, size_t maxlen)
return; return;
} }
offset += ret; offset += ret;
maxlen -= offset; maxlen -= ret;
} }
dst[offset] = 0; dst[offset] = 0;
} }
......
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