]> git.ipfire.org Git - thirdparty/bind9.git/commit
Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.
authorWitold Kręcicki <wpk@isc.org>
Mon, 17 Feb 2020 14:52:09 +0000 (15:52 +0100)
committerWitold Krecicki <wpk@isc.org>
Thu, 27 Feb 2020 12:08:02 +0000 (12:08 +0000)
commitc8dd7e07cd9a74fd03fd3731e57a1bfaece5898f
treedecc3ba6cdaf91b174890f1c2aea69f7f0310665
parent9f7acb1dd03a1ab06a1a629f0d2d9ecfca8b5f99
Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.

Fix a potential assertion failure on shutdown in ns__client_endrequest.
Scenario:
1. We are shutting down, interface->clientmgr is gone.
2. We receive a packet, it gets through ns__client_request
3. mgr == NULL, return
4. isc_nmhandle_detach calls ns_client_reset_cb
5. ns_client_reset_cb calls ns_client_endrequest
6. INSIST(client->state == NS_CLIENTSTATE_WORKING ||
          client->state == NS_CLIENTSTATE_RECURSING) is not met
   - we haven't started processing this packet so
   client->state == NS_CLIENTSTATE_READY.
As a solution - don't do anything in ns_client_reset_cb if the client
is still in READY state.

(cherry picked from commit b0888ff0398687793c83a46a7ce64eea1ca24899)
lib/ns/client.c