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

Re: Adding IPv6 to Perl

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

> > > 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
> > structs.
> Yes, that's true.  But because I don't want to change Perl's existing
> core, then we need different versions of connect, etc. that pass the
> correct structures.

The structs are just a sequence of bytes and the core perl functions
does not even look at them.  For instance 'pp_connect' is:

    addr = SvPV(addrsv, len);
    if (PerlSock_connect(PerlIO_fileno(IoIFP(io)), (struct sockaddr *)addr, len) >= 0)

There is nothing here that knows about 'struct in_addr' for IPv4.  You
just pack the correct thing into the 'addrsv' argument and the right
stuff is eventually passed down to the OS-level connect().  This means
that there is no need to replace perl's connect() function for IPv6.


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