Skip to content
Snippets Groups Projects
Commit 3fc7e424 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

lib/resolve: invalidate NS than query on loops/failures

parent d9bafffb
Branches
Tags
No related merge requests found
......@@ -47,16 +47,18 @@ static int ns_resolve_addr(struct kr_query *qry, struct kr_request *param)
* this would lead to dependency loop in current zone cut.
* Prefer IPv6 and continue with IPv4 if not available.
*/
uint16_t next_type = KNOT_RRTYPE_AAAA;
uint16_t next_type = 0;
if (!(qry->flags & QUERY_AWAIT_IPV6)) {
next_type = KNOT_RRTYPE_AAAA;
qry->flags |= QUERY_AWAIT_IPV6;
} else if (!(qry->flags & QUERY_AWAIT_IPV4)) {
next_type = KNOT_RRTYPE_A;
qry->flags |= QUERY_AWAIT_IPV4;
} else {
}
/* Bail out if the query is already pending or dependency loop. */
if (!next_type || kr_rplan_satisfies(qry->parent, qry->ns.name, KNOT_CLASS_IN, next_type)) {
DEBUG_MSG("=> dependency loop, bailing out\n");
kr_rplan_pop(rplan, qry);
invalidate_ns(rplan, qry);
return KNOT_STATE_PRODUCE;
}
......
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