]> granicus.if.org Git - apache/commitdiff
Fix matching of vhosts by ip address so we find IPv4
authorJeff Trawick <trawick@apache.org>
Wed, 26 Dec 2001 15:51:08 +0000 (15:51 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 26 Dec 2001 15:51:08 +0000 (15:51 +0000)
vhost address when target address is v4-mapped form of
that address.

This problem was reported by Don Hughes.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92607 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/vhost.c

diff --git a/CHANGES b/CHANGES
index 5c4bd81c6fb6ac895cb3641ad49e279d0f9ff875..323c4925607d07d2c3388f8007ccf52cbdc4ab3d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
 Changes with Apache 2.0.30-dev
+
+  *) Fix matching of vhosts by ip address so we find IPv4
+     vhost address when target address is v4-mapped form of
+     that address.  [Jeff Trawick]
+
   *) More performance tweaks to the BNDM string-search algorithm
      used to find "<!--#" tokens in mod_include [Brian Pane]
 
index 23217e324b83dfa1730f7644face2ab998437552..92da4bd310ed7eac86c39df90d51df405ef86b42 100644 (file)
@@ -420,6 +420,16 @@ static APR_INLINE ipaddr_chain *find_ipaddr(apr_sockaddr_t *sa)
                         sa->ipaddr_len)) {
                 return trav;
             }
+#if APR_HAVE_IPV6
+            else if (cur->sa.sin.sin_family == AF_INET &&
+                     sa->sa.sin.sin_family == AF_INET6 &&
+                     IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sa->ipaddr_ptr) &&
+                     !memcmp(&((struct in6_addr *)sa->ipaddr_ptr)->s6_addr[12],
+                             cur->ipaddr_ptr,
+                             4)) {
+                return trav;
+            }
+#endif
         }    
     }
     return NULL;