From: Jeff Trawick Date: Tue, 19 Feb 2002 16:17:24 +0000 (+0000) Subject: fix a v4-specific INADDR_ANY check that kept name-based virtual hosts X-Git-Tag: 2.0.33~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e1f9478dc7731bfc476bba8cdecf7c09c387b1a;p=apache fix a v4-specific INADDR_ANY check that kept name-based virtual hosts from working with IPv6 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93494 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index ce9ddc4c66..ac639a4531 100644 --- 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. diff --git a/server/vhost.c b/server/vhost.c index 6fae3dbc79..4658a43eda 100644 --- a/server/vhost.c +++ b/server/vhost.c @@ -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; }