From patchwork Tue Aug 8 17:01:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 21991 Received: (qmail 43062 invoked by alias); 8 Aug 2017 17:02:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 38203 invoked by uid 89); 8 Aug 2017 17:01:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 08BF27C83E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Tue, 08 Aug 2017 19:01:44 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922] User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20170808170144.407DB4029923B@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2017-08-08 Florian Weimer [BZ #21922] * sysdeps/posix/getaddrinfo.c (gaih_inet): Report EAI_NODATA error coming from gethostbyname2_r. diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 9d9e7e2..0cf87c2 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -619,6 +619,14 @@ gaih_inet (const char *name, const struct gaih_service *service, } *pat = addrmem; } + else + { + if (h_errno == NO_DATA) + result = -EAI_NODATA; + else + result = -EAI_NONAME; + goto free_and_return; + } } else {