This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getaddrinfo fails with EAI_NODATA for some valid hosts with A records


Hi Brian,

On Jan  7 15:39, Brian Inglis wrote:
> getaddrinfo fails with err 7 EAI_NODATA for some valid hosts with A records. 
> Err 7 EAI_NODATA is mapped from WSANO_DATA err 11004 in Windows.
> Can anyone reproduce failure with problem host name below? 

Yes, I can reproduce it, and it's a total surprise.

In fact, this is *not* a Cygwin problem.  I created an STC, a simple
mingw application, very certainly not using Cygwin at all:

$ cat gai.c
#define _WIN32_WINNT 0x0a00
#include <ws2tcpip.h>
#include <windows.h>
#include <stdio.h>

#ifndef AI_DISABLE_IDN_ENCODING
#define AI_DISABLE_IDN_ENCODING 0x80000
#endif

int
main (int argc, char **argv)
{
  WSADATA wsadata;
  struct addrinfo hint, *res;
  int ret;

  WSAStartup (MAKEWORD(2,2), &wsadata);

  memset (&hint, 0, sizeof hint);
  hint.ai_flags = 0;//AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME | AI_DISABLE_IDN_ENCODING;
  hint.ai_family = 0;//AF_INET;
  ret = getaddrinfo (argv[1], NULL, &hint, &res);
  printf ("ret = %d\n", ret);
}
$ x86_64-w64-mingw32-gcc -g -o gai gai.c -lws2_32
$ ./gai cygwin.org
ret = 0
$ ./gai www.sun.de
ret = 0
$ ./gai leapsecond.utcd.org
ret = 11004

I have no idea why Windows' getaddrinfo chokes on leapsecond.utcd.org
at all.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]