Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 29468
Status: open
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: jtk [...] us.ibm.com
Cc: dom [...] cpan.org
MXEY [...] cpan.org
ONEGRAY [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: IPv6 support?
Date: 18 Sep 2007 09:52:31 -0400
To: bug-libwww-perl [...] rt.cpan.org
From: jtk [...] us.ibm.com (John T. Kohl)
libwww-perl-5.808 doesn't support IPv6 connections. I believe the following would do it: * use IO::Socket::INET6 in place of IO::Socket::INET (note, INET6 depends on Socket6) Are you willing to make this a dependency? (I'm not a perl expert) Is there a way to make it use INET6 if present, but INET if not? * update URL host-name parsing to tolerate IPv6 literal addresss in the URLs. (See RFC2732) -- John Kohl Senior Software Engineer - Rational Software - IBM Software Group Lexington, Massachusetts, USA jtk@us.ibm.com <http://www.ibm.com/software/rational/>
From: andrejohn.mas [...] gmail.com
On Tue Sep 18 09:53:16 2007, jtk@us.ibm.com wrote: Show quoted text
> libwww-perl-5.808 doesn't support IPv6 connections. > I believe the following would do it: > > * use IO::Socket::INET6 in place of IO::Socket::INET (note, INET6 > depends on Socket6) > Are you willing to make this a dependency? > (I'm not a perl expert) Is there a way to make it use INET6 if > present, but INET if not? > > * update URL host-name parsing to tolerate IPv6 literal addresss in the > URLs. (See RFC2732) >
I have made some changes for this, but not being an expert Perl programmer there are still some issues, like minor failing of the tests. At the same time the changes allow me to use the w3c validator with both IPv4 and IPv6 sites: http://www.geocities.com/ajmas/software/libwww-perl-5.808-ipv6.tgz I have also added diffs relative to 5.808.

Message body is not shown because it is too large.

If IO::Socket::INET6 was that compatible, why would we not just replace IO::Socket::INET in the perl core? There must be some drawback to this that prevent that approach. Need to analyze what breaks before something like this is tried. A possibility could be to rework Net::HTTP so that it's not a subclass of IO::Socket, but that certainly has it's own issues. We also have other protocol modules (eg for the handling of ftp:) that need treatment. One possibility is to just introduce a separate experimental protocol driver that runs http over IP6 as a start.
From: andrejohn.mas [...] gmail.com
Could this be done in a two stage process? Basically at this point in time we would use IO::Socket::INET6 and then if IO::Socket::INET was ever modified to make INET6 an integral part then we would migrate there. One obvious breakage point would if anyone assumes that they are getting an IPv4 address and end up getting IPv6. Then again in this context it is probably an indication that the developer needs to be updating their program, since even with a non-IPv6 enabled version their program would break. Anything that at this point in time can allow people to play around with IPv6 is a good thing. There certainly seems to be a few people in the w3c-validator team who would be interested in this, for starters.
This bug has also been filed in Debian at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614948. Unfortunately, I cannot add 614948@bugs.debian.org as Cc to this bug. There has been no activity in over two years, but IPv6 support is becoming more important every day. Are there plans to tackle this bug at all?
CC: Ivan Shmakov <oneingray [...] gmail.com>
Subject: [rt.cpan.org #29468] IPv6 support? (patch)
Date: Thu, 29 Mar 2012 22:51:58 +0700
To: bug-libwww-perl [...] rt.cpan.org
From: Ivan Shmakov <oneingray [...] gmail.com>
[I know, I've messed it up. Sorry. This one was previously added to #76044 by mistake. Also to note that this bug is discussed at http://bugs.debian.org/306914.] The way I've dealt with the problem [1] is by requiring IO::Socket::INET6 first, while still allowing the code to fall back to IO::Socket::INET. (Just like Net::HTTP already falls back to IO::Socket if IO::Socket::INET is itself unavailable.) The patch I'm using is MIME'd. [1] http://permalink.gmane.org/gmane.comp.lang.perl.modules.lwp/2556 -- FSF associate member #7257
--- HTTP.pm.~1~ 2012-02-17 03:17:26.000000000 +0700 +++ HTTP.pm 2012-03-27 17:05:37.000000000 +0700 @@ -5,8 +5,13 @@ $VERSION = "6.03"; unless ($SOCKET_CLASS) { - eval { require IO::Socket::INET } || require IO::Socket; - $SOCKET_CLASS = "IO::Socket::INET"; + if (eval { require IO::Socket::INET6 }) { + $SOCKET_CLASS = "IO::Socket::INET6"; + } else { + eval { require IO::Socket::INET } + || require IO::Socket; + $SOCKET_CLASS = "IO::Socket::INET"; + } } require Net::HTTP::Methods; require Carp;
From: andrejohn.mas [...] gmail.com
Given 6 June 12 is being treated as the global IPv6 launch day ( http://www.worldipv6launch.org/ ), I am curious as to where libwww stands with official IPv6 support. This ticket has been open since 2007.
RT-Send-CC: andrejohn.mas [...] gmail.com, oneingray [...] gmail.com
You may want to know about IO::Socket::IP, rather than ::INET6. IO::Socket::IP is a drop-in replacement of IO::Socket::INET that also supports IPv6. There have been long discussions on why it is unsuitable to simply update ::INET to do IPv6 as well - they are elsewhere. To support IPv6 in LWP should be a simple matter of changing the 'use' and constructor lines simply with s/IO::Socket::INET/IO::Socket::IP/g IO::Socket::IP is not /yet/ core, but has no non-core dependencies. I have submitted it for inclusion in core, so it may end up being core sometime in 5.17, for release in 5.18. Additionally, you may wish to note the class method my ( $host, $port ) = IO::Socket::IP->split_addr( "[::1]:80" ); Will correctly split hostname or address-literal and port combinations for both IPv4 and IPv6. -- Paul Evans
2012-06-20 07:57:56, PEVANS писал: Show quoted text
> You may want to know about IO::Socket::IP, rather than ::INET6.
FTR, the logic of the patch I’ve suggested above could (obviously) be extended to select either of the available IPv6-capable modules, or to fall back to IO::Socket::INET should no neither module be found. Show quoted text
> IO::Socket::IP is a drop-in replacement of IO::Socket::INET that also supports IPv6.
AIUI, IO::Socket::INET6 also supports both IPv6 and IPv4. But for the time being (and it’s already quite a while), I’m just using a trivial workaround in my published code; check, for instance, https://metacpan.org/source/ONEGRAY/head-r-0.1/head-r.
From: Mark.Martinec [...] ijs.si
Don't bother with oldish IO::Socket::INET6, just use IO::Socket::IP for both protocol families if the module is available, otherwise fall back to IO::Socket::INET. The IO::Socket::IP is a Perl core module since Perl version 5.19.8, is compatible with IO::Socket::INET, works very well and is being actively maintained, and is easily installable for older versions of Perl. The IO::Socket::IP (in place of IO::Socket::INET) is now used in modules like HTTP::Tiny and Mail::SpamAssassin.
Subject: Re: [rt.cpan.org #29468] IPv6 support?
Date: Tue, 18 Mar 2014 14:16:58 -0700
To: "Mark.Martinec [...] ijs.si via RT" <bug-libwww-perl [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Tue, Mar 18, 2014 at 04:46:38PM -0400, Mark.Martinec@ijs.si via RT wrote: Show quoted text
> Don't bother with oldish IO::Socket::INET6
We really ought to get a deprecation notice on IO::Socket::INET6 so others aren't confused down the road.
From: val [...] bogda.co.uk
Hi, Here's what I had to do to make LWP work with IPv6 addresses. It's not much but the change to LWP::Protocol::http is worrying me a bit because I don't understand why it would not work without it. Regards, kubrat
Subject: LWP-Protocol-http_patch.diff
--- lib/LWP/Protocol/http.pm +++ lib/LWP/Protocol/http.pm @@ -21,20 +21,21 @@ if (my $sock = $conn_cache->withdraw($self->socket_type, "$host:$port")) { return $sock if $sock && !$sock->can_read(0); # if the socket is readable, then either the peer has closed the # connection or there are some garbage bytes on it. In either # case we abandon it. $sock->close; } } local($^W) = 0; # IO::Socket::INET can be noisy + $host = "[$host]" if $host =~ m/:/; my $sock = $self->socket_class->new(PeerAddr => $host, PeerPort => $port, LocalAddr => $self->{ua}{local_address}, Proto => 'tcp', Timeout => $timeout, KeepAlive => !!$conn_cache, SendTE => 1, $self->_extra_sock_opts($host, $port), );
Subject: Net-HTTP_patch.diff
--- lib/Net/HTTP.pm +++ lib/Net/HTTP.pm @@ -1,19 +1,19 @@ package Net::HTTP; use strict; use vars qw($VERSION @ISA $SOCKET_CLASS); $VERSION = "6.01"; unless ($SOCKET_CLASS) { - eval { require IO::Socket::INET } || require IO::Socket; - $SOCKET_CLASS = "IO::Socket::INET"; + eval { require IO::Socket::IP } || require IO::Socket; + $SOCKET_CLASS = "IO::Socket::IP"; } require Net::HTTP::Methods; require Carp; @ISA = ($SOCKET_CLASS, 'Net::HTTP::Methods'); sub new { my $class = shift; Carp::croak("No Host option provided") unless @_; $class->SUPER::new(@_);
From: jfesler [...] gigo.com
I humbly offer: https://github.com/libwww-perl/net-http/pull/10 https://github.com/libwww-perl/libwww-perl/pull/58 The combination will use IO::Socket::IP or IO::Socket::INET6 (if found); and uses URI to do host address parsing (in order to correctly parse [2001:db8::1]:80).
From: jfesler [...] gigo.com
My patches appear to be accepted, and a new release produced. Please consider updating to these packages: Net::HTTP (6.07) LWP (6.080 URI (1.64)