]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove reference count REQUIRE in isc_nm_read()
authorEvan Hunt <each@isc.org>
Mon, 25 Jan 2021 21:14:14 +0000 (13:14 -0800)
committerEvan Hunt <each@isc.org>
Sat, 2 Oct 2021 18:39:56 +0000 (11:39 -0700)
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

index 6f10061fcd90a4e29c9daf285c42880e62c65465..c5f24e51506438c275946c31619e723b14280056 100644 (file)
@@ -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);