On Wed, Jun 06, 2007 at 08:32:12PM -0300, Davi Arnaut wrote: > /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.
AI_NUMERICHOST trumps AI_ADDRCONFIG on some platforms because people infer that if you supply it you are being more specific in your request. The technical reason is because the decision to make an AAAA query or not is buried in their resolver code (*cough*, this may or may not be my fault) , and that code never gets triggered when you use AI_NUMERICHOST. It's not strictly in the letter of rfc3493 though, it's a resolver bug. > /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 Why wouldn't that fail? -- Colm MacCárthaigh Public Key: [EMAIL PROTECTED]