From b220fb32bdb3c70f80b95d3611807deceab2bd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Mon, 28 Feb 2022 10:25:06 +0100 Subject: [PATCH] Handle TCP sockets in isc__nmsocket_reset() The isc__nmsocket_reset() was missing a case for raw TCP sockets (used by RNDC and DoH) which would case a assertion failure when write timeout would be triggered. TCP sockets are now also properly handled in isc__nmsocket_reset(). --- lib/isc/netmgr/netmgr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 313dba78ae..7ede0ec749 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -2851,8 +2851,13 @@ isc__nmsocket_reset(isc_nmsocket_t *sock) { REQUIRE(VALID_NMSOCK(sock)); switch (sock->type) { + case isc_nm_tcpsocket: case isc_nm_tcpdnssocket: case isc_nm_tlsdnssocket: + /* + * This can be called from the TCP write timeout, or + * from the TCPDNS or TLSDNS branches of isc_nm_bad_request(). + */ REQUIRE(sock->parent == NULL); break; default: