mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Reset DNS_{GETDB_STALEFIRST,DBFIND_STALETIMEOUT} in ns__query_start()
In case of chained queries (e.g. CNAME) a discrepancy could arise if the original query had the DNS_GETDB_STALEFIRST bit set, but the next query doesn't have it (e.g. because the CNAME target is a authoritative zone for the server) and cause an unanswered query because of a logic error. Reset both DNS_GETDB_STALEFIRST and DNS_DBFIND_STALETIMEOUT bits in the ns__query_start() function before reevaluating whether they are needed for the current query, and reset them again after calling the query_lookup() function.
This commit is contained in:
parent
0be568f921
commit
65ba05bb68
1 changed files with 8 additions and 0 deletions
|
|
@ -5743,6 +5743,13 @@ ns__query_start(query_ctx_t *qctx) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If this is a chained query (e.g. CNAME), these bits should be reset
|
||||
* to not use the settings from the previous query.
|
||||
*/
|
||||
qctx->options &= ~DNS_GETDB_STALEFIRST;
|
||||
qctx->client->query.dboptions &= ~DNS_DBFIND_STALETIMEOUT;
|
||||
|
||||
if (!qctx->is_zone && (qctx->view->staleanswerclienttimeout == 0) &&
|
||||
dns_view_staleanswerenabled(qctx->view))
|
||||
{
|
||||
|
|
@ -5762,6 +5769,7 @@ ns__query_start(query_ctx_t *qctx) {
|
|||
* when it completes, this option is not expected to be set.
|
||||
*/
|
||||
qctx->options &= ~DNS_GETDB_STALEFIRST;
|
||||
qctx->client->query.dboptions &= ~DNS_DBFIND_STALETIMEOUT;
|
||||
|
||||
cleanup:
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Reference in a new issue