From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12652 Path: news.gmane.org!.POSTED!not-for-mail From: William Pitcock Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] resolver: only exit the search path loop there are a positive number of results given Date: Fri, 30 Mar 2018 18:52:25 +0000 Message-ID: <20180330185225.29656-1-nenolod@dereferenced.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1522435877 18933 195.159.176.226 (30 Mar 2018 18:51:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Mar 2018 18:51:17 +0000 (UTC) Cc: William Pitcock To: musl@lists.openwall.com Original-X-From: musl-return-12666-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 30 20:51:13 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1f1z7J-0004ou-7i for gllmg-musl@m.gmane.org; Fri, 30 Mar 2018 20:51:13 +0200 Original-Received: (qmail 3566 invoked by uid 550); 30 Mar 2018 18:53:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3518 invoked from network); 30 Mar 2018 18:53:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dereferenced-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=5hoRPWgwk4tUt8uGvkSqeuzz5+6CRBEfV2Z//Cnl20A=; b=z3FqMOefcIHN1lKy2GGoNtlKchVwBOou15SjwV4DTexjW18mQRwUarovLiBYb/LcI2 0A3PoDgHsyu4859SerDTw/EYFV9459/meH/oqNxvrI2mqYWLplLhvCFuaY/WwuOBE9cZ jHh1+br5Myv9GeeqI+xQcgLHyS4uWNqd5HmH//rRXZF8xbmurw2A2Ui07/reVwQXibAa QssQhAKryQNDKcqhVzV6Rx/ZsfJRNh54SN42r7tCzeQ8j3LPR0E9Rhy1lqQoV/caS5wW wZAJA1/Co5p1OcTwiuws1dbbiA1A35kkbrhJbpw3guw21Sa5QfFMcDk2eXKt5Mv43pzb W1dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5hoRPWgwk4tUt8uGvkSqeuzz5+6CRBEfV2Z//Cnl20A=; b=o7rq3an4VwjtBw17gFQ3NWdCL1Ks2syMqVVjZhSf6jBiMh+/HBl3L9IfTt8PmEaNsY 46vPzaxqjwzjodkQS4d5uTM0CAwGLXuxzws4wd8Ogn1Z+Qs8S5Ze6psnREfDKWs8fYx0 bDz6rA00aPafKouzMM3zun5EN7Si5BozUZJ8zN2f+/K3FVZe8wz0uAOP4j4kDVDHQfo2 om07XmMd1ZSfhA2QYwkQCZeKBXvm9zxOycboRf8rGv1o+bBfGiVR03oK2A2Go7azavnx rY/cQUJKvMkiR3heta+u+e4HOL37m4Fc7+VnmKCNPG3Fm2dCxfGb7WhHh8Xi3wXwi+ym 6VaQ== X-Gm-Message-State: ALQs6tDZKVawRYwWLNRo+A3ln8aobH1e6yykkBDaalAl8uVaR0oXPuyi jqnb4hUyoD7UzViepFloBP0D2dSR X-Google-Smtp-Source: AIpwx48b7hfi/1IRfcZ1xrfxwRu4+8hFdgKKH0wd8tqI9TIBDieRLSAwNQHksDMpIggfU3D7GAd5RQ== X-Received: by 2002:a9d:5403:: with SMTP id j3-v6mr121435oth.52.1522435982695; Fri, 30 Mar 2018 11:53:02 -0700 (PDT) X-Mailer: git-send-email 2.16.2 Xref: news.gmane.org gmane.linux.lib.musl.general:12652 Archived-At: 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