On 06/06/2007, at 19:06, Davi Arnaut wrote:

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):

[EMAIL PROTECTED]:~/gai$ make gai
cc     gai.c   -o gai
[EMAIL PROTECTED]:~/gai$ ./gai ::1
getaddrinfo("::1", NULL, {.family=AF_UNSPEC, .hints=0}) = 0:
 family=10, proto= 6 inet6: addr=::1, port=0, flowinfo=0
[EMAIL PROTECTED]:~/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
[EMAIL PROTECTED]:~/gai$ ./gai -a ::1
getaddrinfo("::1", NULL, {.family=AF_UNSPEC, .hints=0| AI_ADDRCONFIG}) = -1:
error: Address family for hostname not supported
[EMAIL PROTECTED]:~/gai$ ./gai -a ::1 null inet6
getaddrinfo("::1", NULL, {.family=AF_INET6, .hints=0| AI_ADDRCONFIG}) = -1:
error: Name or service not known


Same machine, now with -n:

[EMAIL PROTECTED]:~/gai$ ./gai -n ::1
getaddrinfo("::1", NULL, {.family=AF_UNSPEC, .hints=0| AI_NUMERICHOST}) = 0:
family=10, proto= 6 inet6: addr=::1, port=0, flowinfo=0
[EMAIL PROTECTED]:~/gai$ ./gai -n ::1 null inet6
getaddrinfo("::1", NULL, {.family=AF_INET6, .hints=0|AI_NUMERICHOST}) = 0:
family=10, proto= 6 inet6: addr=::1, port=0, flowinfo=0
[EMAIL PROTECTED]:~/gai$ ./gai -na ::1
getaddrinfo("::1", NULL, {.family=AF_UNSPEC, .hints=0|AI_ADDRCONFIG| AI_NUMERICHOST}) = -1:
error: Address family for hostname not supported
[EMAIL PROTECTED]:~/gai$ ./gai -na ::1 null inet6
getaddrinfo("::1", NULL, {.family=AF_INET6, .hints=0|AI_ADDRCONFIG| AI_NUMERICHOST}) = -1:
error: Name or service not known



Reply via email to