_Bool NO_NS_FOUND : 1;
_Bool PKT_IS_SANE : 1;
_Bool DNS64_DISABLE : 1;
+ _Bool PASSTHRU_LEGACY : 1;
};
typedef struct ranked_rr_array_entry {
uint32_t qry_uid;
_Bool NO_NS_FOUND : 1;
_Bool PKT_IS_SANE : 1;
_Bool DNS64_DISABLE : 1;
+ _Bool PASSTHRU_LEGACY : 1;
};
typedef struct ranked_rr_array_entry {
uint32_t qry_uid;
_Bool NO_NS_FOUND : 1;
_Bool PKT_IS_SANE : 1;
_Bool DNS64_DISABLE : 1;
+ _Bool PASSTHRU_LEGACY : 1;
};
typedef struct ranked_rr_array_entry {
uint32_t qry_uid;
/* 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;
}
bool PKT_IS_SANE : 1; /**< Set by iterator in consume phase to indicate whether
* some basic aspects of the packet are OK, e.g. QNAME. */
bool DNS64_DISABLE : 1; /**< Don't do any DNS64 stuff (meant for view:addr). */
+ bool PASSTHRU_LEGACY : 1;/**< Ignore local-data overrides/blocks for this kr_request. */
};
/** Combine flags together. This means set union for simple flags. */
daf.add('qname = deny. deny')
daf.add('qname = drop. drop')
- check_answer('daf pass action', 'pass.', kres.type.A, kres.rcode.NOERROR)
+ -- This one won't work anymore, as PASS(THRU) now also skips hints.
+ --check_answer('daf pass action', 'pass.', kres.type.A, kres.rcode.NOERROR)
+
check_answer('daf deny action', 'deny.', kres.type.A, kres.rcode.NXDOMAIN)
check_answer('daf drop action', 'drop.', kres.type.A, kres.rcode.SERVFAIL)
end
-- policy functions are defined below
local policy = {}
-function policy.PASS(state, _)
+function policy.PASS(state, req)
+ policy.FLAGS('PASSTHRU_LEGACY')(state, req)
return state
end