mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] resolver: only exit the search path loop there are a positive number of results given
@ 2018-03-30 18:52 William Pitcock
  2018-03-30 19:14 ` Rich Felker
  0 siblings, 1 reply; 12+ messages in thread
From: William Pitcock @ 2018-03-30 18:52 UTC (permalink / raw)
  To: musl; +Cc: William Pitcock

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-03-31 16:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-30 18:52 [PATCH] resolver: only exit the search path loop there are a positive number of results given William Pitcock
2018-03-30 19:14 ` Rich Felker
2018-03-30 19:19   ` William Pitcock
2018-03-30 19:35     ` Rich Felker
2018-03-30 19:44       ` William Pitcock
2018-03-30 20:24         ` Szabolcs Nagy
2018-03-30 20:33           ` William Pitcock
2018-03-30 20:35         ` Rich Felker
2018-03-30 21:09           ` William Pitcock
2018-03-31 10:42         ` Florian Weimer
2018-03-31 14:01           ` Rich Felker
2018-03-31 16:08             ` Florian Weimer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).