From d9e1ad9e37f7941dff0b19c18ea64cfd7d842467 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 25 Jan 2021 13:14:14 -0800 Subject: [PATCH] Remove reference count REQUIRE in isc_nm_read() Previously isc_nm_read() required references on the handle to be at least 2, under the assumption that it would only ever be called from a connect or accept callback. however, it can also be called from a read callback, in which case the reference count might be only 1. --- lib/isc/netmgr/netmgr.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 6f10061fcd..c5f24e5150 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -2527,13 +2527,6 @@ void isc_nm_read(isc_nmhandle_t *handle, isc_nm_recv_cb_t cb, void *cbarg) { REQUIRE(VALID_NMHANDLE(handle)); - /* - * This is always called via callback (from accept or connect), and - * caller must attach to the handle, so the references always need to be - * at least 2. - */ - REQUIRE(isc_refcount_current(&handle->references) >= 2); - switch (handle->sock->type) { case isc_nm_udpsocket: isc__nm_udp_read(handle, cb, cbarg);