]> granicus.if.org Git - apache/commitdiff
fix a v4-specific INADDR_ANY check that kept name-based virtual hosts
authorJeff Trawick <trawick@apache.org>
Tue, 19 Feb 2002 16:17:24 +0000 (16:17 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 19 Feb 2002 16:17:24 +0000 (16:17 +0000)
from working with IPv6

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

CHANGES
server/vhost.c

diff --git a/CHANGES b/CHANGES
index ce9ddc4c666bcb395959ed4d1509d146a0a9374c..ac639a4531a609638569176a7ab7ad19d5cdaa48 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
 Changes with Apache 2.0.33-dev
 
+  *) Fix IPv6 name-based virtual hosts.  [Jeff Trawick]
+
   *) Introduce AddOutputFilterByType directive.  [Justin Erenkrantz]
 
   *) Fix DEBUG_CGI support in mod_cgi.  PR 9670, 9671.
index 6fae3dbc79c9af19c1fc97536a5032d72285b61c..4658a43eda7f815ccaaee75c576dd8a70718be7e 100644 (file)
@@ -587,10 +587,12 @@ AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_s)
      * occured in the config file, we'll copy it in that order.
      */
     for (sar = name_vhost_list; sar; sar = sar->next) {
+        char inaddr_any[16] = {0}; /* big enough to handle IPv4 or IPv6 */
         unsigned bucket = hash_addr(sar->host_addr);
         ipaddr_chain *ic = new_ipaddr_chain(p, NULL, sar);
 
-        if (sar->host_addr->sa.sin.sin_addr.s_addr != INADDR_ANY) {
+        if (memcmp(sar->host_addr->ipaddr_ptr, inaddr_any, 
+                   sar->host_addr->ipaddr_len)) { /* not IN[6]ADDR_ANY */
             *iphash_table_tail[bucket] = ic;
             iphash_table_tail[bucket] = &ic->next;
         }