Bug 1413065
Summary: | HTTP-Daemon does not support IPv6: Arg length for inet_ntoa | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Deepu K S <dkochuka> | ||||||||||
Component: | perl-HTTP-Daemon | Assignee: | Petr Pisar <ppisar> | ||||||||||
Status: | CLOSED ERRATA | QA Contact: | Martin Kyral <mkyral> | ||||||||||
Severity: | medium | Docs Contact: | Lenka Špačková <lkuprova> | ||||||||||
Priority: | unspecified | ||||||||||||
Version: | 7.3 | CC: | djez, dkochuka, jkejda, jorton, mkyral, ppisar | ||||||||||
Target Milestone: | rc | Keywords: | Patch | ||||||||||
Target Release: | --- | ||||||||||||
Hardware: | x86_64 | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | perl-HTTP-Daemon-6.01-7.el7 | Doc Type: | Release Note | ||||||||||
Doc Text: |
The *HTTP::Daemon* Perl module now supports IPv6
Previously, the *HTTP::Daemon* Perl module did not support IPv6 addresses. Consequently, when running an *HTTP::Daemon::SSL* server on an IPv6 address, the server terminated unexpectedly on an attempt to print the IPv6 address with an `Arg length for inet_ntoa` error message. With this update, the *HTTP::Daemon* module has been ported from the *IO::Socket::INET* to the *IO::Socket::IP* module. As a result, *HTTP::Daemon* handles IPv6 addresses as expected.
|
Story Points: | --- | ||||||||||
Clone Of: | |||||||||||||
: | 1492760 (view as bug list) | Environment: | |||||||||||
Last Closed: | 2018-04-10 08:41:10 UTC | Type: | Bug | ||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | --- | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Bug Depends On: | 1492760 | ||||||||||||
Bug Blocks: | 1380363, 1420851, 1465904, 1466370, 1473612 | ||||||||||||
Attachments: |
|
Description
Deepu K S
2017-01-13 14:27:18 UTC
Created attachment 1240354 [details]
test perl file
Briefly looking at the HTTP::Daemon code, I think HTTP::Daemon does not support IPv6 and it should be ported from IO::Socket::INET to IO::Socket::IP. Regarding the attached reproducer, it uses HTTP::Daemon::SSL not delivered by Red Hat. If I use HTTP-Daemon-SSL-1.04 from CPAN, I even cannot start the reproducer because it complains that "[::]" is unknown service ("unable to create web socket: Name or service not known at test.pl"). If I correct the LocalAddr to "::", then I can only get bug report from HTTP/Daemon.pm line 51 about the same Socket::inet_ntoa issue. Not line 48. How do you invoke an HTTP client? Created attachment 1241332 [details]
Proposed fix
Created attachment 1241785 [details]
Proposed fix
How to test: (1) Create an HTTP::Daemon object with an IPv6 listen address and check that url() method on the object returns HTTP URL a client can connect to. E.g: $ perl -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>q{::1}) or die $@; print $d->url, qq{\n}' Before: It reports this error: HTTP::Daemon: Bad hostname '::1' at -e line 1. After: It prints an URL with "::1" as a host name: http://[::1]:34389/ You try different listen addresses like "127.0.0.1", "::", "0.0.0.0". Please note that in case of unspecified address a hostname is returned. Hello Petr, Can I have a test package pls. A brewbuild would do. Thanks. Unsupported testing build is available on <http://people.redhat.com/~ppisar/perl-HTTP-Daemon-6.01-6.el7/>. Any chance of getting this into RHEL 6? This package is not in RHEL 6. (In reply to Petr Pisar from comment #11) > This package is not in RHEL 6. I see that /usr/share/perl5/vendor_perl/HTTP/Daemon.pm is part of perl-libwww-perl So, any chance of getting into perl-libwww-perl? I wanted to confirm that as we are already into Prod phase 2 for RHEL 6. If possible, I shall open up a seperate BZ for that. Thanks You are right. The module lives in different package. But I'm reluctant to update it in RHEL-6. First the RHEL-6 HTTP::Daemon documentation clearly states that it supports IPv4 only: The C<HTTP::Daemon> is a subclass of C<IO::Socket::INET> and second RHEL-6 is beyond accepting new features. (In reply to Petr Pisar from comment #16) > This is because IO::Socket::IP behaves differently from IO::Socket::INET. > This applies not only to empty string, but also to undef value, or invalid > addresses like q{0.1}. None of the HTTP::Daemon, IO::Socket::IP, and > IO::Socket::INET specifies behavior in these cases. > Reported to IO-Socket-IP upstream <https://rt.cpan.org/Public/Bug/Display.html?id=123069>. (In reply to Petr Pisar from comment #16) > I can introduce special handling for undef and empty string to behave as the > previous implementation, but it's impossible to emulate all the other corner > cases. > Actually this does not work with perl-IO-Socket-IP-0.21-4.el7.noarch because that IO::Socket::IP cannot deal with non-existing LocalAddr argument: $ perl -MIO::Socket::IP -e '$a=IO::Socket::IP->new(Proto=>q{tcp}, Listen=>1) or die qq{Error: $@\n}; print `ss -tnlp`' Error: While it works with latest upstream IO-Socket-IP-0.39: $ perl -MIO::Socket::IP -e '$a=IO::Socket::IP->new(Proto=>q{tcp}, Listen=>1) or die qq{Error: $@\n}; print `ss -tnlp`' State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:22 *:* LISTEN 0 1 :::36309 :::* users:(("perl",pid=13539,fd=3)) LISTEN 0 128 :::22 :::* This incompatibility was probably fixed in IO-Socket-IP-0.25 <https://rt.cpan.org/Public/Bug/Display.html?id=91982> and to be fixed in perl-IO-Socket-IP before we can proceed with this perl-HTTP-Daemon bug. Just a demonstration how it affects perl-HTTP-Daemon: Patched perl-HTTP-Daemon with broken perl-IO-Socket-IP: $ perl -Ilib -MHTTP::Daemon -e '$d=HTTP::Daemon->new() or die $@; print $d->url, qq{\n}' Died at -e line 1. Previous perl-HTTP-Daemon on IO::Socket-INET: [test@rhel-7-5 HTTP-Daemon-6.01]$ perl -MHTTP::Daemon -e '$d=HTTP::Daemon->new() or die $@; print $d->url, qq{\n}' http://rhel-7-5:41466/ (In reply to Petr Pisar from comment #18) > (In reply to Petr Pisar from comment #16) > > I can introduce special handling for undef and empty string to behave as the > > previous implementation, but it's impossible to emulate all the other corner > > cases. > > > Actually this does not work with perl-IO-Socket-IP-0.21-4.el7.noarch because > that IO::Socket::IP cannot deal with non-existing LocalAddr argument: > [...] > This incompatibility was probably fixed in IO-Socket-IP-0.25 > <https://rt.cpan.org/Public/Bug/Display.html?id=91982> and to be fixed in > perl-IO-Socket-IP before we can proceed with this perl-HTTP-Daemon bug. Yes, it was fixed and I have fix prepared in bug #1492760. With the fixed perl-IO-Socket-IP, the special handling for empty and undefined strings works. Created attachment 1327543 [details]
Proposed fix to handle undefined and empty string LocalAddr
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0665 |