summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--server/vhost.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index ea66fbb2e6..20a8b56571 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
Changes with Apache 2.0.29-dev
+ *) Fix a problem with IPv6 vhosts. PR #8118 [Jeff Trawick]
+
*) Optimization for the BNDM string-search function in
mod_include. [Brian Pane]
diff --git a/server/vhost.c b/server/vhost.c
index 56cf8ec1a5..ce1a130b86 100644
--- a/server/vhost.c
+++ b/server/vhost.c
@@ -615,9 +615,11 @@ AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_s)
has_default_vhost_addr = 0;
for (sar = s->addrs; sar; sar = sar->next) {
ipaddr_chain *ic;
+ char inaddr_any[16] = {0}; /* big enough to handle IPv4 or IPv6 */
- if (sar->host_addr->sa.sin.sin_addr.s_addr == DEFAULT_VHOST_ADDR
- || sar->host_addr->sa.sin.sin_addr.s_addr == INADDR_ANY) {
+ if ((sar->host_addr->family == AF_INET &&
+ sar->host_addr->sa.sin.sin_addr.s_addr == DEFAULT_VHOST_ADDR)
+ || !memcmp(sar->host_addr->ipaddr_ptr, inaddr_any, sar->host_addr->ipaddr_len)) {
ic = find_default_server(sar->host_port);
if (!ic || !add_name_vhost_config(p, main_s, s, sar, ic)) {
if (ic && ic->sar->host_port != 0) {