]> git.ipfire.org Git - thirdparty/bind9.git/commit
Keep track of allow client detach
authorMatthijs Mekking <matthijs@isc.org>
Thu, 25 Mar 2021 13:13:35 +0000 (14:13 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 2 Apr 2021 07:14:09 +0000 (09:14 +0200)
commitfee164243f2b17fce550ca0af99f89332be66b3a
tree16a681d6380da33fd677997e469223b04b8a445a
parente7fe606020654290046c620d2da142703620fec1
Keep track of allow client detach

The stale-answer-client-timeout feature introduced a dependancy on
when a client may be detached from the handle. The dboption
DNS_DBFIND_STALEONLY was reused to track this attribute. This overloads
the meaning of this database option, and actually introduced a bug
because the option was checked in other places. In particular, in
'ns_query_done()' there is a check for 'RECURSING(qctx->client) &&
(!QUERY_STALEONLY(&qctx->client->query) || ...' and the condition is
satisfied because recursion has not completed yet and
DNS_DBFIND_STALEONLY is already cleared by that time (in
query_lookup()), because we found a useful answer and we should detach
the client from the handle after sending the response.

Add a new boolean to the client structure to keep track of client
detach from handle is allowed or not. It is only disallowed if we are
in a staleonly lookup and we didn't found a useful answer.
lib/ns/include/ns/client.h
lib/ns/query.c