From: Witold Kręcicki Date: Thu, 12 Dec 2019 21:55:18 +0000 (+0100) Subject: netmgr: issue stop_udp_child synchronously only if we're in this sockets thread X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd3f1f11cfe68d970e75fff38e2c00f93ec1bef7;p=thirdparty%2Fbind9.git netmgr: issue stop_udp_child synchronously only if we're in this sockets thread --- diff --git a/lib/isc/netmgr/udp.c b/lib/isc/netmgr/udp.c index abd950a2790..2ce6541fd6c 100644 --- a/lib/isc/netmgr/udp.c +++ b/lib/isc/netmgr/udp.c @@ -151,6 +151,7 @@ udp_close_cb(uv_handle_t *handle) { static void stop_udp_child(isc_nmsocket_t *sock) { INSIST(sock->type == isc_nm_udpsocket); + INSIST(sock->tid == isc_nm_tid()); uv_udp_recv_stop(&sock->uv_handle.udp); uv_close((uv_handle_t *) &sock->uv_handle.udp, udp_close_cb); @@ -175,7 +176,7 @@ stoplistening(isc_nmsocket_t *sock) { for (int i = 0; i < sock->nchildren; i++) { isc__netievent_udpstop_t *event = NULL; - if (i == sock->tid) { + if (isc_nm_tid() == sock->tid) { stop_udp_child(&sock->children[i]); continue; }