getaddrinfo fails with EAI_NODATA for some valid hosts with A records
Corinna Vinschen
corinna-cygwin@cygwin.com
Fri Jan 8 15:19:00 GMT 2016
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160108/47fc70be/attachment.sig>
More information about the Cygwin
mailing list