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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user