Bug#618315: Acknowledgement (libsocket-getaddrinfo-perl: README.Debian misrepresents the nature of the bin/get{addr, name}info binaries)

Paul LeoNerd Evans leonerd at leonerd.org.uk
Tue Mar 22 11:49:59 UTC 2011


On Tue, Mar 15, 2011 at 10:38:52PM +0000, Nicholas Bamber wrote:
> Paul,
> 	Thanks for all the extra information. At the moment our intention
> is to incorporate all the extra information into README.Debian. The
> objection against putting these scripts into $PATH,
> was that the names were not really clear enough. I think if we could
> change the names to "socket_getaddrinfo" and "socket_getnameinfo" it
> would go through.

I'm not sure what adding the prefix "socket" really buys you.

This is a simple commandline wrapper around a libc function of the same
name. getaddrinfo(1) simply calls getaddrinfo(3).

It's not unlike

 $ getent hosts foobar.com

as a wrapper for gethostbyname()

> 	On an unrelated matter, as the author of IO::Socket::IP, I wonder
> if you have any insight into why IO::Socket::INET does not support
> IPv6.

Short answer: Because it's named INET, and therefore wraps an AF_INET
socket

Long answer:

Having constructed an IO::Socket::INET handle, callers expect that

  unpack_sockaddr_in( $sock->sockname )
  unpack_sockaddr_in( $sock->peername )

will DTRT. I.e. that

  sock_family( IO::Socket::INET->new(...)->sockname ) == AF_INET

It's similar for any other socket type; IO::Socket::RFCOMM, ::Netlink,
::Packet, etc... are all wrappers of one kind of socket family.

Because of the dual IPv4/IPv6 nature of getaddrinfo() lookups, this fact
can no longer be relied upon. Now, it's possible that the family of an
IO::Socket::IP object's addresses could either be AF_INET or AF_INET6.
This would break a lot of underlying assumptions about ::INET sockets,
which is why changing the original code wasn't really an option, and
required a new API instead. The new API is then free to add such other
abilities as multihomed nonblocking connect, which original
IO::Socket::INET could not do.

Hope that helps,

-- 
Paul "LeoNerd" Evans

leonerd at leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20110322/05c295e3/attachment.pgp>


More information about the pkg-perl-maintainers mailing list