On my machine (Debian 9/testing, Linux 4.4), both "t/protocol/echo.t"
and "t/security/CVE-2009-3555.t" fail with:
.... Connect failed: ; Connection refused at
/home/yle/src/apache/asf/httpd/test/framework/trunk/Apache-Test/lib/Apache/TestRequest.pm
line 297.
.... Dubious, test returned 111 (wstat 28416, 0x6f00)

This appears to be due to Perl trying to connect to ::1 (IPv6, as
shown by tcpdump) and failing because httpd Listen-s on 0.0.0.0 (IPv4)
only.
Some other tests do the same (I did not captured all, though) but
somehow they don't fail...

Anyway, I tried to address this by Listen-ing on the port only (hence
any v4 or v6 address), using the attached patch, and indeed the two
tests pass (I first tried to disable IPv6 on my system and that worked
too).
However, there are even more tests failing now...

Anyone ever had this issue?
Why is (our) Perl connecting localhost with IPv6?
Any idea on how to avoid that?

Regards,
Yann.
Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
--- Apache-Test/lib/Apache/TestConfig.pm	(revision 1735819)
+++ Apache-Test/lib/Apache/TestConfig.pm	(working copy)
@@ -1238,7 +1238,8 @@ sub parse_vhost {
     my @out_config = ();
     if ($self->{vhosts}->{$module}->{namebased} < 2) {
         #extra config that should go *outside* the <VirtualHost ...>
-        @out_config = ([Listen => '0.0.0.0:' . $port]);
+        #@out_config = ([Listen => '0.0.0.0:' . $port]);
+        @out_config = ([Listen => $port]);
 
         if ($self->{vhosts}->{$module}->{namebased}) {
             push @out_config => ["<IfVersion < 2.3.11>\n".
@@ -2139,7 +2140,8 @@ perl(1), Apache::Test(3)
 
 
 __DATA__
-Listen     0.0.0.0:@Port@
+#Listen     0.0.0.0:@Port@
+Listen     @Port@
 
 ServerRoot   "@ServerRoot@"
 DocumentRoot "@DocumentRoot@"
Index: Apache-Test/lib/Apache/TestConfigPerl.pm
===================================================================
--- Apache-Test/lib/Apache/TestConfigPerl.pm	(revision 1735819)
+++ Apache-Test/lib/Apache/TestConfigPerl.pm	(working copy)
@@ -270,7 +270,8 @@ sub set_connection_handler {
     my($self, $module, $args) = @_;
     my $port = $self->new_vhost($module);
     my $vars = $self->{vars};
-    $self->postamble(Listen => '0.0.0.0:' . $port);
+    #$self->postamble(Listen => '0.0.0.0:' . $port);
+    $self->postamble(Listen => $port);
 }
 
 my %add_hook_config = (

Reply via email to