diff options
author | menakite <29005531+menakite@users.noreply.github.com> | 2024-08-11 04:07:32 +0200 |
---|---|---|
committer | menakite <29005531+menakite@users.noreply.github.com> | 2024-08-11 04:07:32 +0200 |
commit | 07c1353d0b60cf40c10cbb939b8767a03b24aa0c (patch) | |
tree | a2acfe50fbda41f32e0348e949784d91f8ec7de3 /lib | |
parent | Merge branch 'poe-configure-old-meson' into 'master' (diff) | |
download | knot-resolver-07c1353d0b60cf40c10cbb939b8767a03b24aa0c.tar.xz knot-resolver-07c1353d0b60cf40c10cbb939b8767a03b24aa0c.zip |
iterator: fix handling of ANY queries and != IN classes.
It was supposed to answer NOTIMP, but was returning FAIL instead of
DONE and so the answer was SERVFAIL.
Also added EDE code "Not Supported" for clarity.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/layer/iterate.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index 69fe344c..c6f9ec97 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -922,14 +922,14 @@ static int begin(kr_layer_t *ctx) } struct kr_query *qry = ctx->req->current_query; - /* Avoid any other classes, and avoid any meta-types ~~except for ANY~~. */ - if (qry->sclass != KNOT_CLASS_IN - || (knot_rrtype_is_metatype(qry->stype) - /* && qry->stype != KNOT_RRTYPE_ANY hmm ANY seems broken ATM */)) { + /* Avoid any other classes, and avoid any meta-types. */ + if (qry->sclass != KNOT_CLASS_IN || knot_rrtype_is_metatype(qry->stype)) { knot_pkt_t *ans = kr_request_ensure_answer(ctx->req); - if (!ans) return ctx->req->state; + if (!ans) + return ctx->req->state; knot_wire_set_rcode(ans->wire, KNOT_RCODE_NOTIMPL); - return KR_STATE_FAIL; + kr_request_set_extended_error(ctx->req, KNOT_EDNS_EDE_NOTSUP, "57CK"); + return KR_STATE_DONE; } return reset(ctx); |