Use max-query-restarts in iterative resolver

This commit is contained in:
Christian Allred 2021-04-05 16:25:43 -07:00
parent 0e3068559c
commit 07c0d04a14
3 changed files with 7 additions and 1 deletions

View file

@ -176,6 +176,9 @@ iter_apply_cfg(struct iter_env* iter_env, struct config_file* cfg)
}
iter_env->supports_ipv6 = cfg->do_ip6;
iter_env->supports_ipv4 = cfg->do_ip4;
iter_env->max_query_restarts = cfg->max_query_restarts;
return 1;
}

View file

@ -1237,7 +1237,7 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
/* We enforce a maximum number of query restarts. This is primarily a
* cheap way to prevent CNAME loops. */
if(iq->query_restart_count > MAX_RESTART_COUNT) {
if(iq->query_restart_count > ie->max_query_restarts) {
verbose(VERB_QUERY, "request has exceeded the maximum number"
" of query restarts with %d", iq->query_restart_count);
errinf(qstate, "request has exceeded the maximum number "

View file

@ -139,6 +139,9 @@ struct iter_env {
lock_basic_type queries_ratelimit_lock;
/** number of queries that have been ratelimited */
size_t num_queries_ratelimited;
/** max number of query restarts to limit length of CNAME chain */
size_t max_query_restarts;
};
/**