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

work around HP-UX UDP connect behavior [RT #18202]

This commit is contained in:
Tatuya JINMEI 神明達哉
2008-06-25 22:56:33 +00:00
parent cc758fbc8f
commit 7b0bb3bdc9

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.284 2008/06/25 00:09:50 jinmei Exp $ */
/* $Id: socket.c,v 1.285 2008/06/25 22:56:33 jinmei Exp $ */
/*! \file */
@@ -4390,6 +4390,16 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
sock->peer_address = *addr;
cc = connect(sock->fd, &addr->type.sa, addr->length);
if (cc < 0) {
/*
* HP-UX "fails" to connect a UDP socket and sets errno to
* EINPROGRESS if it's non-blocking. We'd rather regard this as
* a success and let the user detect it if it's really an error
* at the time of sending a packet on the socket.
*/
if (sock->type == isc_sockettype_udp && errno == EINPROGRESS) {
cc = 0;
goto success;
}
if (SOFT_ERROR(errno) || errno == EINPROGRESS)
goto queue;
@@ -4431,6 +4441,7 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
/*
* If connect completed, fire off the done event.
*/
success:
if (cc == 0) {
sock->connected = 1;
sock->bound = 1;