]> granicus.if.org Git - apache/commitdiff
* listen.c (ap_listen_open): Avoid casts when checking for :: and
authorJoe Orton <jorton@apache.org>
Mon, 25 Aug 2003 16:00:49 +0000 (16:00 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 25 Aug 2003 16:00:49 +0000 (16:00 +0000)
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

server/listen.c

index 8b13230304a9ece4ff314675237a728564a5b9d7..49a115a3a6909b1c7a9e7e8c9f33b570e03d7f10 100644 (file)
@@ -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) {