summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2001-11-20 19:27:07 +0100
committerJeff Trawick <trawick@apache.org>2001-11-20 19:27:07 +0100
commit854cfbc2109ff2893d22aeeb97fe9e5ea7df85f8 (patch)
tree2d257b87d2811841db123cdf448b74e2fe4b26d0 /server
parentfix chdir_for_gprof() to s/dir/use_dir/ for chdir() (diff)
downloadapache2-854cfbc2109ff2893d22aeeb97fe9e5ea7df85f8.tar.xz
apache2-854cfbc2109ff2893d22aeeb97fe9e5ea7df85f8.zip
Get IPv6 vhosts working (again ?).
There were a couple of bogus IPv4-specific comparisons which prevented the data structures from being built correctly in ap_fini_vhost_config(). One of these (INADDR_ANY) can be easily rewritten to work with IPv6. The other (DEFAULT_VHOST_ADDR) isn't necessary for IPv6. Note that this is because we don't support the various flavors of _default_ that Apache-1.3+KAME-patch supports. PR: 8118 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92054 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/vhost.c6
1 files changed, 4 insertions, 2 deletions
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) {