apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davi Arnaut <d...@haxent.com.br>
Subject Re: [Vote] Release APR 1.2.9/0.9.14 and apr-iconv 1.2.0
Date Wed, 06 Jun 2007 23:32:12 GMT
Colm MacCarthaigh wrote:
> On Wed, Jun 06, 2007 at 03:05:17PM -0300, Davi Arnaut wrote:
>> It boils down to a combination of ai_flags = AI_ADDRCONFIG and "::1"
>> (loopback address). The test is wrong, it should expect a failure (with
>> the current network_io code adding the AI_ADDRCONFIG flag).
> 
> O.k., I think you're mis-interpretting things here. The purpose of the
> AI_ADDRCONFIG flag is to determine if getaddrinfo should bother to
> return IPv6 addresses or not, it's a basic "Do I actually have IPv6
> connectivity?" test. 

Yes, i'm pretty confused by AI_ADDRCONFIG.

> 
> It works by determining if your system has a useable non-localhost IPv6
> address set, so if I have 2001:770:18::2 on an interface the answer is
> "yes". "::1" is not treated at all differently by getaddrinfo as a
> parameter. Where ::1 comes in is that if it's the only IPv6 address
> configured on your system, the answer to the AI_ADDRCONFIG test is "no". 
> Having ::1 does not mean you have useable IPv6 connectivity generally,
> and so the aim is that the call does not return it.
> 
> In other words, if I ran this test on my system, which does have
> a public IPv6 address, it would work just fine. "::1" as a parameter
> is not special. 
> 
> Does that make sence? I can explain more verbosely too.
> 

Sorry, but i still don't quite understand. For example:

/Users/davi/gai $ ./gai -na ::1
getaddrinfo("::1", NULL, {.family=AF_UNSPEC,
.hints=0|AI_ADDRCONFIG|AI_NUMERICHOST}) = 0:
 family=30, proto= 6 inet6: addr=::1, port=0, flowinfo=0

How come this succeeded? The system doesn't have any public ipv6,
the only "configured" ipv6 address is ::1.

/Users/davi/gai $ ./gai -na
getaddrinfo(NULL, NULL, {.family=AF_UNSPEC,
.hints=0|AI_ADDRCONFIG|AI_NUMERICHOST}) = -1:
error: nodename nor servname provided, or not known

--
Davi Arnaut


Mime
View raw message