From patchwork Mon Jul 30 10:40:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 950809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Nd13tC3l"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="HA9L9H+F"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41fGLz47Wqz9ryt for ; Mon, 30 Jul 2018 20:40:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Mw3Ihyb2uNF4J+APL9KPwfan5Oj+Qc60NoeiRQOLkXY=; b=Nd1 3tC3l9UipdGh6pQloDiQMi1/Pxmx9je3tSVV3Mt94+ebHNztpKrpj+oq/0CBMYA+uTh3WOwtFO/OY t/TL7vNz9QUeTWL84RRoOoW4wWf1JKI9GLLaF/Z4uKXhxxfIF00LQwwHiP1mFQAGva5SxA5hX6+XL lv27Bd71FhjH1Bt8ObTDrZyNs9J0SJ/fGsTFv3yVNe6L7jY48II8O3G4zbYIgZmeF9ircVkyt6+AF j+sUMZj5rRLvKThEQoVUAvQEvmQ+mI9x6m0gnsl5Qv/wL63OLaeKvRQ30PA5GiCSYhuzteKOsnGUO 20Ein5zmGv3ygK0S7ezOvbrZjqL8s6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fk5bl-0007Tx-33; Mon, 30 Jul 2018 10:40:57 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fk5bf-0007J5-JW for linux-snps-arc@lists.infradead.org; Mon, 30 Jul 2018 10:40:54 +0000 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 16D5C10C124A; Mon, 30 Jul 2018 03:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1532947240; bh=icQ6uy3nSNz1HBY9BX0lY4QfBk6t9XWxG1CpMAZrWx8=; h=From:To:Cc:Subject:Date:From; b=HA9L9H+FS+VV3VCNNXSQYKhxtaJDVXhW1htUn5GkuVILLsLHTDZX4BNutF/2VeAhj O1V9JlzBdOvf44vA5NhceGbHufwIWu6vmFs+aUjkGk/GTeNabpuJOzUogWeV49Cgwc LW43+Wu7gBPv6BK7HS3qUrpjgUEMfITe9yLd8VhWQfhO8UATh9zzbRbByJVUJVQ8oK NtLianhsS9QT6vljK8nKeM19I6Dh8Lq/c+27/+v37yfu8xaT4ZSuUfMiP6qDJ2aAgd HcuFi5XBJ94yjF85xPzFYWAawYfe+/ijbruwh8IBNYIWmJQBomRd3anm7UZD7M/Ick 3mzN/W0w8JdZA== Received: from abrodkin-7480l.internal.synopsys.com (unknown [10.121.8.87]) by mailhost.synopsys.com (Postfix) with ESMTP id 0F2D836CB; Mon, 30 Jul 2018 03:40:38 -0700 (PDT) From: Alexey Brodkin To: libc-alpha@sourceware.org Subject: [PATCH] posix/tst-getaddrinfo4: Consider EAI_NODATA as an expected result Date: Mon, 30 Jul 2018 13:40:36 +0300 Message-Id: <20180730104036.4016-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180730_034051_991403_550F55D7 X-CRM114-Status: UNSURE ( 7.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-snps-arc@lists.infradead.org, Alexey Brodkin MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some proxy DNS servers might not resolve IPv6 names to addresses. Instead they reply with NOERROR while passing no real data. That combination of NOERROR and EAI_NODATA happen because the DNS server has a recored for requested name (example.net in our case) but that record is not of AAAA type which was requested. That's what Wireshark sees in that case: ---------------------------------->8----------------------------- Domain Name System (response) Transaction ID: 0x6e2e Flags: 0x8180 Standard query response, No error 1... .... .... .... = Response: Message is a response .000 0... .... .... = Opcode: Standard query (0) .... .0.. .... .... = Authoritative: Server is not an authority for domain .... ..0. .... .... = Truncated: Message is not truncated .... ...1 .... .... = Recursion desired: Do query recursively .... .... 1... .... = Recursion available: Server can do recursive queries .... .... .0.. .... = Z: reserved (0) .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server .... .... ...0 .... = Non-authenticated data: Unacceptable .... .... .... 0000 = Reply code: No error (0) Questions: 1 Answer RRs: 0 Authority RRs: 0 Additional RRs: 0 Queries example.net: type AAAA, class IN Name: example.net [Name Length: 11] [Label Count: 2] Type: AAAA (IPv6 Address) (28) Class: IN (0x0001) ---------------------------------->8----------------------------- And that's what we see if Google DNS server (8.8.8.8) is used instead: ---------------------------------->8----------------------------- Domain Name System (response) Transaction ID: 0x3cd4 Flags: 0x8180 Standard query response, No error 1... .... .... .... = Response: Message is a response .000 0... .... .... = Opcode: Standard query (0) .... .0.. .... .... = Authoritative: Server is not an authority for domain .... ..0. .... .... = Truncated: Message is not truncated .... ...1 .... .... = Recursion desired: Do query recursively .... .... 1... .... = Recursion available: Server can do recursive queries .... .... .0.. .... = Z: reserved (0) .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server .... .... ...0 .... = Non-authenticated data: Unacceptable .... .... .... 0000 = Reply code: No error (0) Questions: 1 Answer RRs: 1 Authority RRs: 0 Additional RRs: 0 Queries example.net: type AAAA, class IN Name: example.net [Name Length: 11] [Label Count: 2] Type: AAAA (IPv6 Address) (28) Class: IN (0x0001) Answers example.net: type AAAA, class IN, addr 2606:2800:220:1:248:1893:25c8:1946 ---------------------------------->8----------------------------- --- posix/tst-getaddrinfo4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/posix/tst-getaddrinfo4.c b/posix/tst-getaddrinfo4.c index dc9e423448af..0139dee777a1 100644 --- a/posix/tst-getaddrinfo4.c +++ b/posix/tst-getaddrinfo4.c @@ -39,6 +39,7 @@ try (const char *service, int family, int flags) case 0: case EAI_AGAIN: case EAI_NONAME: + case EAI_NODATA: printf ("SUCCESS getaddrinfo(service=%s, family=%d, flags=%d): %s: %m\n", service ?: "NULL", family, flags, gai_strerror (res)); return 0;