From dea874302ba5ad3c46ea15a4a07eb670cf676a99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 23 May 2017 21:30:54 +0200 Subject: [PATCH] Revert "iterator: don't retry if REFUSED" This reverts commit bc2a26702e6460aee65fe170671336d670ba3eb9 (almost). It would be best to avoid retrying with the same NS and keep trying with others (if any), but that would require larger changes if it should work well, so let's err on the side of sending more queries. --- NEWS | 2 ++ lib/layer/iterate.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index faa9a05ac..4a146652b 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ Improvements - allow answering from cache in non-iterative modes (#122) - command line: specify ports via @ but still support # for compatibility - policy: recognize 100.64.0.0/10 as local addresses +- layer/iterate: *do* retry repeatedly if REFUSED, as we can't yet easily + retry with other NSs while avoiding retrying with those who REFUSED Knot Resolver 1.2.6 (2017-04-24) diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index d0e67eb3f..e955aa77d 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -905,6 +905,7 @@ 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 & QUERY_STUB) { break; } /* Pass through in stub mode */ VERBOSE_MSG("<= rcode: %s\n", rcode ? rcode->name : "??"); @@ -917,7 +918,6 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt) return KR_STATE_CONSUME; } } - case KNOT_RCODE_REFUSED: case KNOT_RCODE_FORMERR: case KNOT_RCODE_NOTIMPL: VERBOSE_MSG("<= rcode: %s\n", rcode ? rcode->name : "??"); -- 2.47.2