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: getaddrinfo on Ubuntu
Date Wed, 06 Jun 2007 22:06:48 GMT
Joe Orton wrote:
> On Wed, Jun 06, 2007 at 10:57:00PM +0300, Lucian Adrian Grijincu wrote:
>> This is the output:
>> getaddrinfo AF_UNSPEC/SOCK_STREAM/AI_ADDRCONFIG failed
>> so, yes:     hints.ai_flags = AI_ADDRCONFIG; makes getaddrinfo fail.
> 
> Just so I can understand the precise nuances of this, can you post the 
> output of:
> 
> wget http://people.apache.org/~jorton/gai.c
> make gai
> ./gai ::1
> ./gai ::1 null inet6
> ./gai -a ::1
> ./gai -a ::1 null inet6


Ubuntu 7.04 (no ipv6 addresses -- other then loopback -- configured):

davi@karmic:~/gai$ make gai
cc     gai.c   -o gai
davi@karmic:~/gai$ ./gai ::1
getaddrinfo("::1", NULL, {.family=AF_UNSPEC, .hints=0}) = 0:
 family=10, proto= 6 inet6: addr=::1, port=0, flowinfo=0
davi@karmic:~/gai$ ./gai ::1 null inet6
getaddrinfo("::1", NULL, {.family=AF_INET6, .hints=0}) = 0:
 family=10, proto= 6 inet6: addr=::1, port=0, flowinfo=0
davi@karmic:~/gai$ ./gai -a ::1
getaddrinfo("::1", NULL, {.family=AF_UNSPEC, .hints=0|AI_ADDRCONFIG}) = -1:
error: Address family for hostname not supported
davi@karmic:~/gai$ ./gai -a ::1 null inet6
getaddrinfo("::1", NULL, {.family=AF_INET6, .hints=0|AI_ADDRCONFIG}) = -1:
error: Name or service not known


> But yes, testsockets.c will need some tweaking to cope with this 
> getaddrinfo implementation.  I think it's caused by an Ubuntu patch, if 
> I read https://bugs.launchpad.net/ubuntu/+source/netcfg/+bug/24828 
> correctly.  It might break some applications in fun ways too, but 
> there's not much APR can do about that.

Interesting bits of documentation:

win32:

"If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
returned only if an IPv4 address is configured on the local system, and
IPv6 addresses shall be returned only if an IPv6 address is configured
on the local system. The IPv4 or IPv6 loopback address is not considered
a valid global address."

RFC 3943:

"If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
returned only if an IPv4 address is configured on the local system,
and IPv6 addresses shall be returned only if an IPv6 address is
configured on the local system.  The loopback address is not
considered for this case as valid as a configured address."

Solaris:

"If the AI_ADDRCONFIG flag is specified, IPv4 addresses are returned
only if an IPv4 address is configured on the local system, and IPv6
addresses are returned only if an IPv6 address is configured on the
local system. For this case, the loopback address is not considered to
be as valid as a configured address. "

--
Davi Aranut


Mime
View raw message