Adrian Knoth <adi_at_[hidden]>:
>(I really prefer the v6-mapped-v4 solution with a single
> socket, thus eliminating this problem)
One little problem here is that it is possible to disable the
IPv6-mapped IPv4 addresses at least under Linux and some BSD variants.
For Linux, have a look at sys.net.ipv6.bindv6only. Some authors even
recommend to do so for security considerations (for example, Murphy &
Malone in IPv6 Network Administration, O'Reilly 2005).
So the approach that maximizes the environments where it works out of
the box is this: Call getaddrinfo with PF_UNSPEC and open a socket for
each IP version it returns (usually this means two sockets on
IPv6-enabled hosts, but this may change in the future... who knows?)
If the connection handling code already makes use of one big select
loop, this should not be *too* hard...
Christian
--
Dipl.-Inf. Christian Kauhaus <><
Lehrstuhl fuer Rechnerarchitektur und -kommunikation
Institut fuer Informatik * Ernst-Abbe-Platz 1-2 * D-07743 Jena
Tel: +49 3641 9 46376 * Fax: +49 3641 9 46372 * Raum 3217
|