2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 09:05:40 +00:00

address race condition with multiple isc_socket_connect calls in change 4041

This commit is contained in:
Mark Andrews
2015-02-18 23:32:31 +11:00
parent e58eb371a0
commit 6a837e5121
2 changed files with 20 additions and 0 deletions

View File

@@ -5719,6 +5719,16 @@ isc__socket_connect(isc_socket_t *sock0, isc_sockaddr_t *addr,
goto queue;
}
if (sock->connected) {
INSIST(isc_sockaddr_equal(&sock->peer_address, addr));
dev->result = ISC_R_SUCCESS;
isc_task_send(task, ISC_EVENT_PTR(&dev));
UNLOCK(&sock->lock);
return (ISC_R_SUCCESS);
}
/*
* Try to do the connect right away, as there can be only one
* outstanding, and it might happen to complete.