]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
iterate: do not treat REFUSED as soft fail with retries
authorMarek Vavruša <mvavrusa@cloudflare.com>
Thu, 12 Apr 2018 08:32:34 +0000 (01:32 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
REFUSED means the NS isn't authoritative for given zone, so it
shouldn't be treated like SERVFAIL. This fixes when a server is not
authoritative for given zone (failed transfer, bad delegation), and the
resolver enters into a retry loop and eventually runs out of time,
instead of trying different servers.

lib/layer/iterate.c

index e094dbb6181241b9c7dbebb3988fd499426dccd0..32aa0e1728c6f796c88fc8455f612e2530f66a01 100644 (file)
@@ -1056,7 +1056,6 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt)
        case KNOT_RCODE_NOERROR:
        case KNOT_RCODE_NXDOMAIN:
                break; /* OK */
-       case KNOT_RCODE_REFUSED:
        case KNOT_RCODE_SERVFAIL: {
                if (query->flags.STUB) {
                         /* Pass through in stub mode */
@@ -1074,6 +1073,7 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt)
                        return KR_STATE_CONSUME;
                }
        }
+       case KNOT_RCODE_REFUSED:
        case KNOT_RCODE_FORMERR:
                VERBOSE_MSG("<= rcode: %s\n", rcode ? rcode->name : "??");
                return resolve_badmsg(pkt, req, query);