Ian
Ian

Reputation: 13852

Perl IO::Socket::INET6::sockaddr_in6 redefined error

We have a custom perl install (5.10.1) in /usr/share, and I tried to do a 'cpan -i' install of GeoIP2 here

After doing this, it seemed to install a lot of dependencies I couldn't keep track of, and since I've been getting an error

Subroutine IO::Socket::INET6::sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67

On most scripts that we run that uses a 'use' command. I've been trying to nail down which module eventually calls that, but not succeeded as yet.

After some research, one suggestion was to comment out the following lines of

/usr/share/perl5/IO/Socket/INET6.pm # (version 2.56, think latest is 2.72)


###commented out the following
###use Socket6 (
###    qw(AI_PASSIVE inet_ntop inet_pton getaddrinfo
###    sockaddr_in6 unpack_sockaddr_in6_all pack_sockaddr_in6_all)
###);

This has stopped the errors from appearing on various scripts. Does anyone know if this is safe to do (ie will it cause further problems later), and is there a better way to go (ie is it possible to just update that module, I'm guessing that would cause problems and break other stuff?). What would be the best method of getting the module updated correctly ?

Upvotes: 3

Views: 4505

Answers (2)

LeoNerd
LeoNerd

Reputation: 8542

Easiest is just to stop using IO::Socket::INET6 at all. That was created a very long time ago, but a far better solution has been created using the core Socket module, being IO::Socket::IP. Furthermore, this latter module is now core also since the newly-released 5.20. it would be better to use that IO::Socket::IP as that is the new core-recommended way to achieve IPv4/IPv6 transparency from now on.

Upvotes: -1

AKHolland
AKHolland

Reputation: 4445

This was a bug in IO::Socket::INET6 which was fixed in version 2.69 according to this bug report:

Subroutine main::sockaddr_in6 redefined at /usr/share/perl/5.14/Exporter.pm line 67.

...

Should be fixed in 2.69.

You can update the module using cpan with the command cpan IO::Socket::INET6 from the shell as root.

Upvotes: 7

Related Questions