Commit 374c9e71 authored by Marek Vavruša's avatar Marek Vavruša

lib/resolve: root zone is always encloser

bad control flow, the zone cut should be checked for root, as the second
condition checks if SNAME is at/below cut so the outcome is the same for
root query
parent 2a6510b7
......@@ -162,7 +162,7 @@ static int ns_fetch_cut(struct kr_query *qry, struct kr_request *req, knot_pkt_t
/* If at/subdomain of parent zone cut, start from its encloser.
* This is for case when we get to a dead end (and need glue from parent), or DS refetch. */
struct kr_query *parent = qry->parent;
if (parent && qry->sname[0] != '\0' && knot_dname_in(parent->, qry->sname)) {
if (parent && parent->[0] != '\0' && knot_dname_in(parent->, qry->sname)) {
const knot_dname_t *encloser = knot_wire_next_label(parent->, NULL);
ret = kr_zonecut_find_cached(req->ctx, &qry->zone_cut, encloser, &txn, qry->timestamp.tv_sec, secured);
} else {
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