2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Fix more races between connect and shutdown

There were more races that could happen while connecting to a
socket while closing or shutting down the same socket.  This
commit introduces a .closing flag to guard the socket from
being closed twice.
This commit is contained in:
Ondřej Surý
2020-10-29 12:04:00 +01:00
committed by Ondřej Surý
parent 6cfadf9db0
commit ed3ab63f74
4 changed files with 99 additions and 50 deletions

View File

@@ -201,6 +201,7 @@ typedef struct isc__nm_uvreq {
uv_pipe_t ipc; /* used for sending socket
* uv_handles to other threads */
union {
uv_handle_t handle;
uv_req_t req;
uv_getaddrinfo_t getaddrinfo;
uv_getnameinfo_t getnameinfo;
@@ -465,6 +466,7 @@ struct isc_nmsocket {
* If active==false but closed==false, that means the socket
* is closing.
*/
atomic_bool closing;
atomic_bool closed;
atomic_bool listening;
atomic_bool listen_error;