2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Fix a race in tcpdns close with uv_close on timer

stop timers before closing

netmgr: tcpdns_close needs to be asynchronous, it manipulates sock->timer
This commit is contained in:
Witold Kręcicki
2019-12-06 22:25:52 +01:00
parent 23ab349bbd
commit 3e66b7ba1c
4 changed files with 60 additions and 26 deletions

View File

@@ -122,6 +122,7 @@ typedef enum isc__netievent_type {
netievent_udpstoplisten,
netievent_tcpstoplisten,
netievent_tcpclose,
netievent_tcpdnsclose,
netievent_prio = 0xff, /* event type values higher than this
* will be treated as high-priority
* events, which can be processed
@@ -194,6 +195,7 @@ typedef isc__netievent__socket_t isc__netievent_udpstoplisten_t;
typedef isc__netievent__socket_t isc__netievent_tcpstoplisten_t;
typedef isc__netievent__socket_t isc__netievent_tcpstopchildlisten_t;
typedef isc__netievent__socket_t isc__netievent_tcpclose_t;
typedef isc__netievent__socket_t isc__netievent_tcpdnsclose_t;
typedef isc__netievent__socket_t isc__netievent_startread_t;
typedef isc__netievent__socket_t isc__netievent_pauseread_t;
typedef isc__netievent__socket_t isc__netievent_closecb_t;
@@ -644,6 +646,9 @@ isc__nm_tcpdns_close(isc_nmsocket_t *sock);
* Close a TCPDNS socket.
*/
void
isc__nm_async_tcpdnsclose(isc__networker_t *worker, isc__netievent_t *ievent0);
#define isc__nm_uverr2result(x) \
isc___nm_uverr2result(x, true, __FILE__, __LINE__)
isc_result_t