From patchwork Wed Apr 16 14:08:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 577 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 3E2F4360078 for ; Wed, 16 Apr 2014 07:07:46 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id E9FD84133B1AB; Wed, 16 Apr 2014 07:07:45 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id AE98E413784E1 for ; Wed, 16 Apr 2014 07:07:45 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=Z3FOMwnQKmLopOfUoS9yaxfl0JF88 XYJiXYbtzc7pBd8WxHkW13cfl3cv/pRE2bMVUM5AlpQo+m4xFHkfcjyYMviMapmp PKLmMznDS3saz4YjwK3ZuMVCG6dRoi4GfzS65A9J6GqQa/qhJxCXiMq4xWTSUYhq pVycnwA7x+UVOg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=ONJCHz2xJ7Pwd9oSNjby8eZARNE=; b=lxc /6ys2aNzkLGF4CGBMRpuBCFMGn6zsYFfMfM0aPDZMeQxYfAKe+yWyT2y6OaI+/bd iU0NfAzDnKc60lglfw2yiAx0QJM5olHUPVpW9DHNJvpSrzaHyd9NNsg8MJi3BVwh 3Ue2/9WUyAn5KKQ5RNEesyFfWzYGp4x3uFP+i1Ow= Received: (qmail 11760 invoked by alias); 16 Apr 2014 14:07:43 -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 11747 invoked by uid 89); 16 Apr 2014 14:07:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Wed, 16 Apr 2014 19:38:24 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [PATCH] Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849) Message-ID: <20140416140823.GA30967@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) X-DH-Original-To: glibc@patchwork.siddhesh.in getaddrinfo correctly returns EAI_AGAIN for AF_INET and AF_INET6 queries. For AF_UNSPEC however, an older change (a682a1bf553b1efe4dbb03207fece5b719cec482) broke the check and due to that the returned error was EAI_NONAME. This patch fixes the check so that a non-authoritative not-found is returned as EAI_AGAIN to the user instead of EAI_NONAME. Tested on x86_64. Siddhesh [BZ #16849] * sysdeps/posix/getaddrinfo.c (gaih_inet): Only check for herrno to return EAI_AGAIN. --- sysdeps/posix/getaddrinfo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 3385bed..f62df19 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -863,8 +863,7 @@ gaih_inet (const char *name, const struct gaih_service *service, if (status != NSS_STATUS_TRYAGAIN || rc != ERANGE || herrno != NETDB_INTERNAL) { - if (status == NSS_STATUS_TRYAGAIN - && herrno == TRY_AGAIN) + if (herrno == TRY_AGAIN) no_data = EAI_AGAIN; else no_data = herrno == NO_DATA;