You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2002/02/19 17:17:25 UTC
cvs commit: httpd-2.0/server vhost.c
trawick 02/02/19 08:17:24
Modified: . CHANGES
server vhost.c
Log:
fix a v4-specific INADDR_ANY check that kept name-based virtual hosts
from working with IPv6
Revision Changes Path
1.593 +2 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.592
retrieving revision 1.593
diff -u -r1.592 -r1.593
--- CHANGES 19 Feb 2002 04:45:53 -0000 1.592
+++ CHANGES 19 Feb 2002 16:17:24 -0000 1.593
@@ -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.
1.68 +3 -1 httpd-2.0/server/vhost.c
Index: vhost.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/vhost.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- vhost.c 26 Dec 2001 21:25:54 -0000 1.67
+++ vhost.c 19 Feb 2002 16:17:24 -0000 1.68
@@ -587,10 +587,12 @@
* 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;
}