From 73c8e2c84f25da97f24e204e98dff2136cf54f1f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 28 May 2014 23:10:51 +0100 Subject: [PATCH] tolerate libc giving NONAME when we have more subtle answer --- client/addrtext.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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"); -- 2.30.2