From patchwork Thu May 23 23:40:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1104545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4595gD4QR8z9s6w for ; Fri, 24 May 2019 09:43:52 +1000 (AEST) Received: from localhost ([127.0.0.1]:44688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTxNG-0000bI-JX for incoming@patchwork.ozlabs.org; Thu, 23 May 2019 19:43:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTxKZ-0007TG-7a for qemu-devel@nongnu.org; Thu, 23 May 2019 19:41:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTxKY-0003e5-67 for qemu-devel@nongnu.org; Thu, 23 May 2019 19:41:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33328) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTxKY-0003dQ-16 for qemu-devel@nongnu.org; Thu, 23 May 2019 19:41:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46184772DD; Thu, 23 May 2019 23:40:48 +0000 (UTC) Received: from localhost (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53A2E600C4; Thu, 23 May 2019 23:40:40 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Fri, 24 May 2019 01:40:11 +0200 Message-Id: <20190523234011.583-5-marcandre.lureau@redhat.com> In-Reply-To: <20190523234011.583-1-marcandre.lureau@redhat.com> References: <20190523234011.583-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 23 May 2019 23:40:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] qemu-sockets: do not require configured ipv4/ipv6 address X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" podman containers without network don't have ipv4/ipv6 addresses other than loopback address. However, some of our tests require getaddrinfo("127.0.0.1") to succeed. Alternatively, we may want to treat 127.0.0.1 as a special case, to keep the AI_ADDRCONFIG convenience. Signed-off-by: Marc-André Lureau --- util/qemu-sockets.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 8850a280a8..f9c1392a05 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -31,10 +31,6 @@ #include "qapi/qobject-output-visitor.h" #include "qemu/cutils.h" -#ifndef AI_ADDRCONFIG -# define AI_ADDRCONFIG 0 -#endif - #ifndef AI_V4MAPPED # define AI_V4MAPPED 0 #endif @@ -385,7 +381,7 @@ static struct addrinfo *inet_parse_connect_saddr(InetSocketAddress *saddr, memset(&ai, 0, sizeof(ai)); - ai.ai_flags = AI_CANONNAME | AI_ADDRCONFIG; + ai.ai_flags = AI_CANONNAME; if (atomic_read(&useV4Mapped)) { ai.ai_flags |= AI_V4MAPPED; } @@ -472,7 +468,7 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr, /* lookup peer addr */ memset(&ai,0, sizeof(ai)); - ai.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ADDRCONFIG; + ai.ai_flags = AI_CANONNAME | AI_V4MAPPED; ai.ai_family = inet_ai_family_from_address(sraddr, &err); ai.ai_socktype = SOCK_DGRAM;