summaryrefslogtreecommitdiffstats
path: root/lib/cache
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2022-02-11 11:44:00 +0100
committerVladimír Čunát <vladimir.cunat@nic.cz>2023-06-12 10:32:27 +0200
commitf14a30d3e4ea0c5eecc39ff98dd6aaf5d65d8128 (patch)
tree9f8865dcfa99571ed236d453ce9c915b223dc01e /lib/cache
parentnew policy engine - prototype (diff)
downloadknot-resolver-f14a30d3e4ea0c5eecc39ff98dd6aaf5d65d8128.tar.xz
knot-resolver-f14a30d3e4ea0c5eecc39ff98dd6aaf5d65d8128.zip
make policy.PASS also affect the new-policy rules
Diffstat (limited to 'lib/cache')
-rw-r--r--lib/cache/api.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/cache/api.c b/lib/cache/api.c
index 501d6839..804de6f8 100644
--- a/lib/cache/api.c
+++ b/lib/cache/api.c
@@ -340,12 +340,14 @@ int cache_peek(kr_layer_t *ctx, knot_pkt_t *pkt)
/* TODO: we _might_ want to process rules here even when some of the cache
* exit-conditions happen, though I don't expect these cases to be important. */
- int ret = kr_rule_local_data_answer(qry, pkt);
- if (ret != -ENOENT) {
- return ret;
+ if (!req->options.PASSTHRU_LEGACY) {
+ int ret = kr_rule_local_data_answer(qry, pkt);
+ if (ret != -ENOENT) {
+ return ret;
+ }
}
- ret = peek_nosync(ctx, pkt);
+ int ret = peek_nosync(ctx, pkt);
kr_cache_commit(&req->ctx->cache);
return ret;
}