[EMAIL PROTECTED] writes:
> trawick 01/12/26 07:51:08
>
> Modified: . CHANGES
> server vhost.c
> Log:
> Fix matching of vhosts by ip address so we find IPv4
> vhost address when target address is v4-mapped form of
> that address.
> +#if APR_HAVE_IPV6
> + else if (cur->sa.sin.sin_family == AF_INET &&
> + sa->sa.sin.sin_family == AF_INET6 &&
> + IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sa->ipaddr_ptr) &&
> + !memcmp(&((struct in6_addr *)sa->ipaddr_ptr)->s6_addr[12],
> + cur->ipaddr_ptr,
> + 4)) {
> + return trav;
> + }
> +#endif
> }
> }
> return NULL;
apr_ipsub_test() should work fine here, though I suspect that a
cleaner solution to both Apache uses of IN6_IS_ADDR_V4MAPPED() would
be to have a way to get a v4 addr from an APR sockaddr (returning NULL
if it is a non-mapped IPv6 address), or better yet, have a way to
compare the IP addresses associated with two APR sockaddrs. The APR
routine would handle any checks for IN6_IS_ADDR_V4MAPPED() under the
covers.
--
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...