After upgrading from Debian Lenny to Squeeze, I got my application exiting with this error:
Bad arg length for Socket::inet_ntoa, length is 16, should be 4 at /app/lib/HTTP/Daemon.pm line 48
The offending line is from HTTP/Daemon.pm is:
$url .= gethostbyaddr($addr, AF_INET) || inet_ntoa($addr);
$addr is returned by $self->sockaddr, and since HTTP::Daemon does not override this method, sockaddr() comes from its parent, IO::Socket::INET. From the number of bytes I'm guessing this is a IPv6/IPv4 thingy? If I print unpack("h*", $addr), it's just a bunch of \x00 though...
Anyway, I'm placing a workaround like this before line 48:
if (length($addr) == 16) { $addr = substr($addr, 12) }
My app now runs as usual, but I'm sure this is not proper. Any insights on why this is happening and how to properly solve this? Thanks.
In reply to IO::Socket::INET's sockaddr() returns 16 byte instead of 4, Socket::inet_ntoa() complains by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |