Serve-stale "staleonly" recursion race condition
Fixes a couple of things with the serve-stale implementation.
- Use a different variable for determining whether we can detach the client from the nmhandle. Using
DNS_DBFIND_STALEONLY
flag for this is information overload and makes things more confusing (first commit) - We can now actually simplify the logic when to detach the client (third commit)
- Refactor the try stale lookup, make the "staleonly" scenario look more similar to the other scenarios (second commit, I apologize for the diff).
- Add code to remove rdatasets from the message that were added on a "staleonly" lookup.
- Remove the
result == ISC_R_SUCCESS
exception on "staleonly" lookups (use the same logic for "stale found" as in other stale lookup scenarios (dbfind_stale, stale_refresh_window). - Fix restoring the RECURSIONOK attribute after a "staleonly" lookup.
- Bail "stale-answer-client-timeout" lookup if RPZ processing is on.
Closes #2594 (closed)
Edited by Michał Kępień