|
Message-Id: <20180330185225.29656-1-nenolod@dereferenced.org> Date: Fri, 30 Mar 2018 18:52:25 +0000 From: William Pitcock <nenolod@...eferenced.org> To: musl@...ts.openwall.com Cc: William Pitcock <nenolod@...eferenced.org> Subject: [PATCH] resolver: only exit the search path loop there are a positive number of results given In the event of no results being given by any of the lookup modules, EAI_NONAME will still be thrown. This is intended to mitigate problems that occur when zones are hosted by weird DNS servers, such as the one Cloudflare have implemented, and appear in the search path. --- src/network/lookup_name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index 209c20f0..b068bb92 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -202,7 +202,7 @@ static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[ memcpy(canon+l+1, p, z-p); canon[z-p+1+l] = 0; int cnt = name_from_dns(buf, canon, canon, family, &conf); - if (cnt) return cnt; + if (cnt > 0) return cnt; } } -- 2.16.2
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.