$OpenBSD: patch-network_io_unix_sockets_c,v 1.3 2007/04/26 16:05:01 kurt Exp $ --- network_io/unix/sockets.c.orig Sat Nov 11 06:07:48 2006 +++ network_io/unix/sockets.c Sat Apr 25 19:43:26 2009 @@ -256,6 +256,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,