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
This commit is contained in:
Jeff Trawick
2002-02-19 16:17:24 +00:00
parent 6e4ccb7c53
commit 0e1f9478dc
2 changed files with 5 additions and 1 deletions

View File

@ -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;
}