ADDRINFO use [Was: Windows breakage with cr_net.h]

Samuel Thibault <[email protected]>
Newsgroups gmane.comp.graphics.chromium.devel
Message-ID <[email protected]>
Hi

Le lun 21 jun 2004 à 17:23:28 -0700, Mike Houston a tapoté sur son clavier :
> The other oddity is that the changes to support IPv6 seem to always kick 
> us into using ADDRINFO on recent versions of Linux.  This works,

Of course it does, to support IPv6 whenever available. getaddrinfo()'s
interface was specially design to always work: the dns lookup may
report ipv4 and ipv6 addresses, getaddrinfo() gives them all. If an
ipv6 address is given but doesn't work either because lack of support
in the kernel (ENOAFSUPPORT) or for network reasons, the connection
will revert back to ipv4.

> but moves all streams to PF instead of AF.

PF / AF ??
That means Protocol Family / Address Family.

There's actually no difference between them, except maybe some minor
differences in the numbering (there is none under linux for instance),
and the *good* one to use for getaddrinfo in the hints structure *is*
PF_something, since we tell the Protocol Family we'd like to use for
conencting (here, unspecified). Then getaddrinfo may report
AF_something to tell which address family it found. I just checked
this once again in Gisèle Cizault's book "IPv6 Théorie et pratique"

> Things work, I just want to point out that this probably shouldn't
> be default behavior.  We probably only really want to kick across
> to PF streams when actually using IPv6 to connect.

Currently, we actually *precisely* use PF_INET when not using IPv6 to
connect.

Regards,
Samuel Thibault


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.