[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IPv6 socket programming



¡Hola!

> > OTOH, in linux, if you bind an IPv6 socket to a port, you can't bind an
> > IPv4 socket to the same port anymore, the call will fail with 'Address
> > already in use'.  Instead, the IPv6 socket would get all IPv4 packets as
> > well.  Basically you should just break out of the loop after the listen,
> > assuming all the preceding calls succeeded.
> Ah hence the "great bind doesn't work right" email debate last month.
> (it wasn't a flame, it was very constructive).

> Am I guaranteed that the first item in the res linked list will be
> the IPv6 address?  If the list is random, then I'll randomly bind to a
> IPv4 or IPv6 address depending on how the library feels.

While you maybe can be guaranteed that, you cannot write portable code
using that suposition (your code won't work on obsd, nt, netbsd configured
that way or when a protocol other than ipv6 and with no ipv4 mappings is
enabled)

> > Someone correct me if I'm wrong, but I think this different behaviour of
> > bind() is the current showstopper for writing portable IPv6 applications.
> It seems that way. That's unfortunate.

:-(

>   - Craig

					HoraPe
---
Horacio J. Peña
horape@compendium.com.ar
horape@uninet.edu
bofh@puntoar.net.ar
horape@hcdn.gov.ar



Reply to: