You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Yann Ylavic <yl...@gmail.com> on 2016/03/20 01:18:13 UTC

Test framework vs IPv6

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.

Re: Test framework vs IPv6

Posted by Yann Ylavic <yl...@gmail.com>.
On Mon, Mar 21, 2016 at 10:00 AM, Plüm, Rüdiger, Vodafone Group
<ru...@vodafone.com> wrote:
>
>> From: Stefan Eissing
>> Sent: Montag, 21. März 2016 09:48
>>
>> I encountered this once on a new image where /etc/hosts listed first
>> localhost ::1

Mine is listing 127.0.0.1 first, so it may depend on the network stack
too (I run some pretty young Linux 4.4 kernel..).
I'll try the other way around though, but it can't be a solution anyway.
It worked with sysctl -w net.ipv6.conf.lo.disable_ipv6=0 for me.

>>
>> Like you, I found that there seems to be no quick fix for this and
>> edited /etc/hosts...
>>
>> I think your listen patch should be applied.
>
> +1

OK, I'll (try to) fix the other tests which don't pass with "Listen <port>"...
Namely:
- t/apache/expr.t
- t/modules/access.t
- t/modules/setenvif.t
- t/ssl/varlookup.t

It may be related to REMOTE_ADDR being IPv6 now, will check.

>
> Just one comment on the patch. If you want to keep the old code in as commented
> you should probably put in a comment above that explains the issue with IPv6.
> Otherwise I guess it is somewhat pointless to keep old code commented out.
> We are under version control :-)

Yes, a quick patch, not meant to be committed as is, more to keep the
original code in mind while trying several things :)

Regards,
Yann.

RE: Test framework vs IPv6

Posted by Plüm, Rüdiger, Vodafone Group <ru...@vodafone.com>.

> -----Original Message-----
> From: Stefan Eissing [mailto:stefan.eissing@greenbytes.de]
> Sent: Montag, 21. März 2016 09:48
> To: dev@httpd.apache.org
> Subject: Re: Test framework vs IPv6
> 
> Yann,
> 
> I encountered this once on a new image where /etc/hosts listed first
> localhost ::1
> 
> Like you, I found that there seems to be no quick fix for this and
> edited /etc/hosts...
> 
> I think your listen patch should be applied.

+1

Just one comment on the patch. If you want to keep the old code in as commented
you should probably put in a comment above that explains the issue with IPv6.
Otherwise I guess it is somewhat pointless to keep old code commented out.
We are under version control :-)

Regards

Rüdiger

> 
> -Stefan
> 
> > Am 20.03.2016 um 01:18 schrieb Yann Ylavic <yl...@gmail.com>:
> >
> > 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.
> > <framework_listen_any.patch>


Re: Test framework vs IPv6

Posted by Stefan Eissing <st...@greenbytes.de>.
Yann,

I encountered this once on a new image where /etc/hosts listed first 
localhost ::1

Like you, I found that there seems to be no quick fix for this and
edited /etc/hosts...

I think your listen patch should be applied.

-Stefan

> Am 20.03.2016 um 01:18 schrieb Yann Ylavic <yl...@gmail.com>:
> 
> 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.
> <framework_listen_any.patch>