]> granicus.if.org Git - apache/commitdiff
<VirtualHost myhost> now applies to all IP addresses for myhost
authorJeff Trawick <trawick@apache.org>
Fri, 11 Jun 2004 13:44:14 +0000 (13:44 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 11 Jun 2004 13:44:14 +0000 (13:44 +0000)
instead of just the first one reported by the resolver.  This
corrects a regression since 1.3.

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

CHANGES
server/vhost.c

diff --git a/CHANGES b/CHANGES
index 7c6ea61a69b442da4fb7c4274fc25c6e413c4e0f..9387fe33e1b82dd4e01ca01a1817e5f919321022 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) <VirtualHost myhost> now applies to all IP addresses for myhost
+     instead of just the first one reported by the resolver.  This
+     corrects a regression since 1.3.  [Jeff Trawick]
+
   *) <IfModule> now recognizes the module identifier in addition to the
      file name. PR 29003.  [Edward Rudd <eddie omegaware.com>, AndrĂ© Malo]
 
index 9ea6782296cf7645f92a6f4fb6f1c093054187b6..86119e4834f74a73f8cd8bdc2e96bd04e45adce9 100644 (file)
@@ -197,15 +197,18 @@ static const char *get_addresses(apr_pool_t *p, const char *w_,
         }
     }
 
-    /* XXX Gotta go through *all* addresses for the host name! 
-     * Fix apr_sockaddr_info_get() to save them! */
-
-    sar = apr_pcalloc(p, sizeof(server_addr_rec));
-    **paddr = sar;
-    *paddr = &sar->next;
-    sar->host_addr = my_addr;
-    sar->host_port = port;
-    sar->virthost = host;
+    /* Remember all addresses for the host */
+
+    do {
+        sar = apr_pcalloc(p, sizeof(server_addr_rec));
+        **paddr = sar;
+        *paddr = &sar->next;
+        sar->host_addr = my_addr;
+        sar->host_port = port;
+        sar->virthost = host;
+        my_addr = my_addr->next;
+    } while (my_addr);
+
     return NULL;
 }