Gisle,
        I have looked into this a  bit more. The facts are as far as I can see:

* The module names INET and INET6 relate directly to AF_INET and AF_INET6 constants in sys/socket.h (or at the very least a lot of code is thought to make this or related assumptions). This is why IO::Socket::INET will never support IPv6.

* IO::Socket::INET6 and IO::Socket::IP were written specifically to deal with this issue.

* People are actively working on getting IPv6 support at the IO::Socket::* level into perl core. It did not seem likely that it would get into perl 5.14 to me.

* I think I have spotted an issue directly in the Net::HTTP code. In Net::HTTP::Methods::http_configure the $peer variable is parsed into hostname/IP address and optional port by using the ':' seperator. This of course is going to break if the hostname is an IPv6 address.

On Debian (which now has a minimum perl version 5.10.1) we could probably cook a regular expression that would easily get us out of that hole. But I am not sure how widely applicable that would be.

Nicholas


On 13/03/11 12:27, Nicholas Bamber wrote:
Gisle
I have to apologize I have not really tried to study this code in detail
so far. I have just been trying to understand the issues and the
dependencies between the various modules.

 >> I have not followed what the current state of this is. What prevents
the
 >>> core IO::Socket::INET from just working with IPv6?

Whilst this seems the most logical cause of action, I have some evidence
that it simply will not happen. I am still trying to get to the bottom
of why this should be so, but here is a straw in the wind. The
IO::Socket::SSL module (which is optionally used by Net::HTTPS) already
uses IO::Socket::INET6 if it is available and IO::Socket::INET otherwise.

Thus it seems to me the option which most sails with the wind is:
1.) Modify Net::HTTP to use IO::Socket::INET6 if it is available and
IO::Socket::INET otherwise.
2.) Work with the author of IO::Socket::INET6 to improve its portability.

As Michiel points out there are other options, but I think the analysis
above (if it holds good) implicitly deals with that.

As far as I can see the modules lacking a clear copyright statement are:

File::Listing
WWW:RobotRules
Mozilla::CA

Nicholas


On 11/03/11 17:18, Michiel Beijen wrote:
Gisle,

On Fri, Mar 11, 2011 at 3:06 PM, Nicholas
Bamber<nicho...@periapt.co.uk>wrote:



Seems wrong to me to start depending on the non-core IO::Socket::INET6.
Does that module even work on Windows?

--Gisle



I have not looked into this issue in detail either. Getting it fixed
in IO::Socket::INET seems pretty logical to me and I will make
enquiries in
that area. I cannot help thinking that someone must have tried that
before
though.


Please look at Paul Evans' IO::Socket::IP which can do both IPv4 and
IPv6 in
a transparent fashion. Ref:
http://leonerds-code.blogspot.com/2011/01/ipv6-in-perl.html

I guess you're right in stating that preferably you should want to
depend on
a core module. It just might be that IO::Socket::IP should become a
part of
core in 5.14, then.

--
Mike




Reply via email to