develooper Front page | perl.perl5.porters | Postings from August 2001

Re: Adding IPv6 to Perl

Thread Previous | Thread Next
Gisle Aas
August 17, 2001 14:12
Re: Adding IPv6 to Perl
Message ID:
Jeff Okamoto <> writes:

> This is a summary of what I think needs to be done with Perl to make it
> IPv6 compatible.
> 1.  No changes to core of Perl.  The existing core networking functions
> will not be changed, and thus will not be IPv6-compatible.

This I don't get.  To me the existing core networking functions seems
to be totally IPv6-compatible.  You just pass them different kind of

> 2.  Old IPv4 scripts will work without needing any changes.  Until, that
> is, either the system they are running on or the version of Perl they
> are using no longer supports IPv4.


> 3. Perl will remain IPv4 compatible as long as the underlying operating
> system supports it.


> 4. The new Socket6 module will only include IPv6 routines.  The old Socket
> module will be left alone.

Seems ok.  What is wrong with the module that is on CPAN now?

Seems also possible to add functions like sockaddr_in6 to the existing  I actually think I would prefer that.

> Reason: Too many other modules inherit from IO::Socket.  The Principle of
> Least Astonishment and the desire for backward-compatibility have precedence.

What does IO::Socket have to do with it?  It should not be affected by
an IPv6 enabled

> 5. IO::Socket::INET will split into INET4 and INET6.  INET will create
> delegations to either INET4 or INET6, on a "smart" basis with overrides
> via the environment and/or a package local.  This will occur at DNS
> lookup time in the case of a client program.  It could occur as early
> as socket creation time, if the proper flags are passed or environment 
> variables set.

Why can't we just make IO::Socket::INET do the right thing.  If it is
passed in a literal IPv6 address make an IPv6 socket.  If it is passed
a hostname look the host up.  If it has AAAA records use IPv6.  If it
only has A record use that.  There might be some environment variable
to select what to prefer when both A and AAAA records are available.

> Open, ongoing discussion issues:
> String representation of an IPv6 address, and of an IPv4-encapsulated
> address.  TMTOWTDI.

Why not simply follow the RFCs and the C libraries.  It seems like
IO::Socket::INET's ctor need to do something similar to RFC 2732 since
it allow URL-like spec of host and port in a single string.

> How Configure will tell if a system is IPv6-compatible



Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About