2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Fix improper closed connection handling in tcpdns.

If dnslisten_readcb gets a read callback it needs to verify that the
outer socket wasn't closed in the meantime, and issue a CANCELED callback
if it was.
This commit is contained in:
Witold Kręcicki
2020-10-31 21:08:53 +01:00
committed by Ondřej Surý
parent f8730ae1a2
commit 3ab3d90de0

View File

@@ -259,6 +259,11 @@ dnslisten_readcb(isc_nmhandle_t *handle, isc_result_t eresult,
REQUIRE(VALID_NMSOCK(dnssock));
REQUIRE(dnssock->tid == isc_nm_tid());
REQUIRE(VALID_NMHANDLE(handle));
if (eresult == ISC_R_SUCCESS &&
(!isc__nmsocket_active(dnssock) || dnssock->outerhandle == NULL))
{
eresult = ISC_R_CANCELED;
}
if (region == NULL || eresult != ISC_R_SUCCESS) {
/* Connection closed */