httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [Patch] Better IPv6 detection and configuration
Date Mon, 29 Mar 2004 23:43:25 GMT
Philippe M. Chiasson wrote:
> After a bit of poking around different flavors of IPv6 systems, I've
> encountered a few situations where Apache::Test ends up configuring
> httpd in a way that can't be tested.
> This typically only happens on a system that has IPv4-mapped IPv6
> addresses disabled, i.e. OpenBSD. If the hostname that is picked
> to form the Listen directives happens to have both an IPv4 and an
> IPv6 address, i.e localhot on OpenBSD, the server will start but will
> only be listening on an IPv6 address.
> And since LWP doesn't do requests over IPv6, all tests will fail.
> The following patch attempts to do handle all this by doing one of a few
> many things.


> If the server has ipv4-mapped addresses, Listen to *:port, forcing the
> use of ipv4-mapped addresses and insuring that the server will be
> available over it's ipv4 address.
> Otherwise try to use Socket6 to see if the hostname is both v4 and v6
> and Listen to *:port as well. Without Socket6 (not part of the Perl
> core), just warn the user about possible problems he/she will run into
> if the selected hostname happens to be ipv6.
> +        else {
> +            if (eval { require Socket6 }) {
> +                if (Socket6::gethostbyname2($name, Socket6::AF_INET6())) {
> +                    $self->{vars}{listen_addr} = '*';
> +                }
> +            }
> +            else {
> +                warning "Socket6 not installed";
> +                warning "Test might fail if your hostname: '$name' has an IPv6 address";

I think we should die here:

   error << EOI;
Your system is configured to run both ipv6 and ipv4, but the right interface 
can't be selected.
Please install the perl CPAN module Socket6 and re-run the last command.
   die "\n";

and if Socket6 builds everywhere, and including older perls, we should include 
it in Apache-Test's %PREREQ_PM.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message