diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-08-19 15:42:11 +0200 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-08-19 15:53:56 +0200 |
commit | b5b117bf66480aa5f73221a81a0fb841c2d90638 (patch) | |
tree | 4397cf1dc8d675bbfc21c3283365d219dfc00060 /lib | |
parent | validator: avoid clearing EDE if query didn't actually fail (diff) | |
download | knot-resolver-b5b117bf66480aa5f73221a81a0fb841c2d90638.tar.xz knot-resolver-b5b117bf66480aa5f73221a81a0fb841c2d90638.zip |
validator nit: move validate_wrapper() to a better place
Diffstat (limited to 'lib')
-rw-r--r-- | lib/layer/validate.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/layer/validate.c b/lib/layer/validate.c index 45522fa2..395640cc 100644 --- a/lib/layer/validate.c +++ b/lib/layer/validate.c @@ -1320,6 +1320,15 @@ static int validate(kr_layer_t *ctx, knot_pkt_t *pkt) VERBOSE_MSG(qry, "<= answer valid, OK\n"); return KR_STATE_DONE; } +static int validate_wrapper(kr_layer_t *ctx, knot_pkt_t *pkt) { + // Wrapper for now. + int ret = validate(ctx, pkt); + struct kr_request *req = ctx->req; + struct kr_query *qry = req->current_query; + if (ret & KR_STATE_FAIL && qry->flags.DNSSEC_BOGUS) + qry->server_selection.error(qry, req->upstream.transport, KR_SELECTION_DNSSEC_ERROR); + return ret; +} /** * Hide RRsets which did not validate from clients and clear Extended @@ -1372,16 +1381,6 @@ static int validate_finalize(kr_layer_t *ctx) { return ctx->state; } -static int validate_wrapper(kr_layer_t *ctx, knot_pkt_t *pkt) { - // Wrapper for now. - int ret = validate(ctx, pkt); - struct kr_request *req = ctx->req; - struct kr_query *qry = req->current_query; - if (ret & KR_STATE_FAIL && qry->flags.DNSSEC_BOGUS) - qry->server_selection.error(qry, req->upstream.transport, KR_SELECTION_DNSSEC_ERROR); - return ret; -} - /** Module implementation. */ int validate_init(struct kr_module *self) |