public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: getaddrinfo fails with EAI_NODATA for some valid hosts with A records
Date: Fri, 08 Jan 2016 15:19:00 -0000	[thread overview]
Message-ID: <20160108111408.GH20447@calimero.vinschen.de> (raw)
In-Reply-To: <loom.20160107T163448-78@post.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-01-08 11:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 15:39 Brian Inglis
2016-01-08 15:19 ` Corinna Vinschen [this message]
2016-01-08 18:52   ` cyg Simple
2016-01-08 19:03     ` Corinna Vinschen
2016-01-08 20:50       ` Andy Hall
2016-01-10  9:15         ` Brian Inglis
2016-01-10 12:12           ` Brian Inglis
2016-01-08 19:48     ` Stephen John Smoogen
2016-01-13 10:16   ` Brian Inglis
2016-01-13 15:12     ` Corinna Vinschen
2016-01-13 20:25     ` Andy Hall
2016-01-14  9:17       ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160108111408.GH20447@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).