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: 339598 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 2702E140096 for ; Thu, 17 Apr 2014 00:07:49 +1000 (EST) 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=VAkU+csYkuwSxY8YLn+haJSmiD12v AmPb8jQuR8usUDv/xPpQGVn3HS4+sdIHe4UkfCO2Huk005qlKfP5khuzYk65W9n2 fEw+nocBx9PDXcoYNgPnlO68pORI36oeqYS1SBNCYKKS0AfkWmh7FvRuU6hudU2j U1oN0Ig84OG05M= 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=cZF 8izSCGPWd+UKMh0Fg0lbSWYP0F7iUGUXESQICksmXuMnvIeYc/T0bKOKvziQdMBc yvitts/BKaaUla9dADhZOTggOU5ym8xcyq5s6BHbRy5a011RurU9yF4boJTKJkuk QmLqM4YxYnbbicQvGxQNDQTjJKWdN2bFs+bkjMFI= 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) 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;