in reply to Re: Activeperl 5.16.1 Ipv6 support
in thread Activeperl 5.16.1 Ipv6 support

Thanks for the insight. I was able to reckon that the Socket library must have no support for the Ipv6. In other words, the Socket must be only Ipv4 compatible. Then I came across this bug reported months back.

https://rt.cpan.org/Public/Bug/Display.html?id=79110#txn-1160212

As suggested in the above bug discussion, I force installed the Socket library and now the library supports Ipv6. I dont see the error anymore.

Replies are listed 'Best First'.
Re^3: Activeperl 5.16.1 Ipv6 support
by Apero (Scribe) on Dec 01, 2015 at 13:42 UTC

    Good find, and I'm glad it's working for you.

    If you're interested in reporting this as a bug against Activeperl (provided the version you're using is actively supported) it might be worth your time to let them know that defaults builds of built-in classes lack IPv6 support, and presumably a brief description of the issue and a link to that bug should be all they need to fix it in later releases.

    from the looks of the CPAN bug you linked, this is an issue in the Socket class which provides some system-call integration involving address resolution, and that is what lacks IPv6 support, even when IO::Socket::IP does support it.In this day there's no good reason for out-of-the-box software not to at least support it.

      Thanks. I thought I am all set to announce that my application now supports Dual stack IP. But, the issue is still seen in Perl 5.16 32 bit. I am all set for 64 bit Perl. In case of Perl 32 bit, even after doing the "force install Socket", the below line is giving me error.

      my $sock = IO::Socket::IP->new( Family => Socket->AF_INET6, PeerHost => $ipv61, PeerPort => "22", Timeout => 3 ) or die "Cannot construct socket - $@";

      Error: Nodename nor servname provided"

      Clearly, the above error is thrown by getaddrinfo. when I debugged further, I see the Socket library is reporting that getaddrinfo is not defined. When I studied the Socket.pm code, I found that there is a different function called "fake_getaddrinfo" which will be used in case if getaddrinfo is not defined. And going through fake_getaddrinfo code tells me that this function doesn't support IPv6 family.

      My only hope is to find out why in Perl 5.16(32 bit) the socket library reports that getaddrinfo is undefined.

      Any suggestions would help me close this issue. I also feel that this issue could only be fixed in the Socket library itself. In this case, what is the probability that the library author would be willing to fix? given that we are dealing with an older version of Perl altogether.

      A small note: I cannot really go for latest version of Perl like 5.20/5.22 since I have dependencies on other components in my environment.

        There is IO::Socket::IP, which claims to be family neutral and largely compatible to IO::Socket. Maybe it installs on your version of Perl.

        There also is the Socket module, which is similar-but-not-identical to IO::Socket, maybe you can write wrappers for the functions that are missing.