From: Joe Orton Date: Mon, 25 Aug 2003 16:00:49 +0000 (+0000) Subject: * listen.c (ap_listen_open): Avoid casts when checking for :: and X-Git-Tag: pre_ajp_proxy~1216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba375b841e9d1ec69b9c9040bf6c9ce294bc7154;p=apache * listen.c (ap_listen_open): Avoid casts when checking for :: and 0.0.0.0 to fix build on FreeBSD 4.2, and fix logic. Reviewed by: Colm MacCarthaigh git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101096 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/listen.c b/server/listen.c index 8b13230304..49a115a3a6 100644 --- a/server/listen.c +++ b/server/listen.c @@ -355,11 +355,11 @@ static int ap_listen_open(apr_pool_t *pool, apr_port_t port) */ if (previous != NULL && lr->bind_addr->family == APR_INET && - *((in_addr_t *)lr->bind_addr->ipaddr_ptr) == INADDR_ANY && + lr->bind_addr->sa.sin.sin_addr.s_addr == INADDR_ANY && lr->bind_addr->port == previous->bind_addr->port && previous->bind_addr->family == APR_INET6 && IN6_IS_ADDR_UNSPECIFIED( - (struct in6_addr*)(previous->bind_addr->ipaddr_ptr)) && + &previous->bind_addr->sa.sin6.sin6_addr) && apr_socket_opt_get(previous->sd, APR_IPV6_V6ONLY, &v6only_setting) == APR_SUCCESS && v6only_setting == 0) { @@ -382,10 +382,10 @@ static int ap_listen_open(apr_pool_t *pool, apr_port_t port) */ if (lr->next != NULL && lr->bind_addr->family == APR_INET6 && IN6_IS_ADDR_UNSPECIFIED( - (struct in6_addr*)(previous->bind_addr->ipaddr_ptr)) && + &lr->bind_addr->sa.sin6.sin6_addr) && lr->bind_addr->port == lr->next->bind_addr->port && - *((in_addr_t *)lr->next->bind_addr->ipaddr_ptr) - == INADDR_ANY) { + lr->next->bind_addr->family == APR_INET && + lr->next->bind_addr->sa.sin.sin_addr.s_addr == INADDR_ANY) { /* Remove the current listener from the list */ if (previous) {