Commit 66b858c3 authored by Vladimír Čunát's avatar Vladimír Čunát Committed by Petr Špaček

lib/resolve: drop a piece cycle-avoidance code

- It was too aggressive.  Example I ran into: we have glue address
  in qry->ns but we want to find authoritative record by asking the NS.
- The anti-cycling measures are probably not perfect yet,
  but they seem to be fine enough and this commit seems
  very unlikely to make anything worse in practice.
parent ad81423f
......@@ -28,6 +28,8 @@ Bugfixes
- TLS fixes for corner cases (!700, !714, !716, !721)
- fix build with -DNOVERBOSELOG (#424)
- policy.{FORWARD,TLS_FORWARD,STUB}: respect net.ipv{4,6} setting (!710)
- avoid SERVFAILs due to certain kind of NS dependency cycles, again
(#374) this time seen as 'circular dependency' in verbose logs
Improvements
------------
......
......@@ -344,29 +344,14 @@ static int ns_resolve_addr(struct kr_query *qry, struct kr_request *param)
invalidate_ns(rplan, qry);
return kr_error(EHOSTUNREACH);
}
struct kr_query *next = qry;
if (knot_dname_is_equal(qry->ns.name, qry->sname) &&
qry->stype == next_type) {
if (!(qry->flags.NO_MINIMIZE)) {
qry->flags.NO_MINIMIZE = true;
qry->flags.AWAIT_IPV6 = false;
qry->flags.AWAIT_IPV4 = false;
VERBOSE_MSG(qry, "=> circular dependency, retrying with non-minimized name\n");
} else {
qry->ns.reputation |= KR_NS_NOIP4 | KR_NS_NOIP6;
kr_nsrep_update_rep(&qry->ns, qry->ns.reputation, ctx->cache_rep);
invalidate_ns(rplan, qry);
VERBOSE_MSG(qry, "=> unresolvable NS address, bailing out\n");
return kr_error(EHOSTUNREACH);
}
} else {
/* Push new query to the resolution plan */
next = kr_rplan_push(rplan, qry, qry->ns.name, KNOT_CLASS_IN, next_type);
if (!next) {
return kr_error(ENOMEM);
}
next->flags.NONAUTH = true;
/* Push new query to the resolution plan */
struct kr_query *next =
kr_rplan_push(rplan, qry, qry->ns.name, KNOT_CLASS_IN, next_type);
if (!next) {
return kr_error(ENOMEM);
}
next->flags.NONAUTH = true;
/* At the root level with no NS addresses, add SBELT subrequest. */
int ret = 0;
if (qry->zone_cut.name[0] == '\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