forked from isc-projects/bind9
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up stale response lookup before query_done() is called
When something goes wrong while recursing for an answer to a query, query_gotanswer() sets a flag (qctx->want_stale) in the query context. query_done() is subsequently called and it can either set up a stale response lookup (if serve-stale is enabled) or conclude that a SERVFAIL response should be sent. This may cause confusion when looking at query error logs since the QUERY_ERROR() line responsible for setting the response's RCODE to SERVFAIL is not in a catch-all branch of a switch statement inside query_gotanswer() (like it is for authoritative responses) but rather in a code branch which appears to have something to do with serve-stale, even when the latter is not enabled. Extract the part of query_done() responsible for checking serve-stale configuration and optionally setting up a stale response lookup into a separate function, query_usestale(), shifting the responsibility for setting the response's RCODE to SERVFAIL to the same QUERY_ERROR() line in query_gotanswer() which is evaluated for authoritative responses.
- Loading branch information
Showing
1 changed file
with
57 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters