From: Ian Jackson Date: Wed, 28 May 2014 22:10:51 +0000 (+0100) Subject: tolerate libc giving NONAME when we have more subtle answer X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=73c8e2c84f25da97f24e204e98dff2136cf54f1f;p=adns.git tolerate libc giving NONAME when we have more subtle answer --- diff --git a/client/addrtext.c b/client/addrtext.c index 950d901..136de26 100644 --- a/client/addrtext.c +++ b/client/addrtext.c @@ -124,9 +124,19 @@ static void dotest(const char *input) { air->ai_family, (long)air->ai_addrlen, air->ai_addr, air->ai_next); printf(":"); - if (our_r==EINVAL && libc_r==EAI_NONAME && !air) { - printf(" invalid"); - goto ok; + if (libc_r==EAI_NONAME && !air) { + if (strchr(input,'%') && (our_r==ENOSYS || our_r==ENXIO)) { + printf(" bad-scope"); + goto ok; + } + if (strchr(input,'%') && our_r==ENOSYS) { + printf(" bad-scope"); + goto ok; + } + if (our_r==EINVAL) { + printf(" invalid"); + goto ok; + } } printf(" valid");