$OpenBSD: patch-network_io_unix_sockets_c,v 1.3 2007/04/26 16:05:01 kurt Exp $ --- network_io/unix/sockets.c.orig Mon Jun 22 20:54:28 2009 +++ network_io/unix/sockets.c Sat Jul 4 22:34:46 2009 @@ -298,6 +298,15 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { int rc; +/* + * OpenBSD doesn't support connect() to INADDR_ANY so convert to + * INADDR_LOOPBACK to emulate what is expected. + */ +#if defined(__OpenBSD__) || defined(__FabBSD__) + if (sa->family == APR_INET) + if (sa->sa.sin.sin_addr.s_addr == INADDR_ANY) + sa->sa.sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif do { rc = connect(sock->socketdes,