From patchwork Thu Oct 20 16:25:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13013919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B199C433FE for ; Thu, 20 Oct 2022 18:13:54 +0000 (UTC) Received: from localhost ([::1]:59794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olZHC-0001DV-Em for qemu-devel@archiver.kernel.org; Thu, 20 Oct 2022 13:24:14 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olYt9-0005Oh-BB for qemu-devel@archiver.kernel.org; Thu, 20 Oct 2022 12:59:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olYNH-0004o5-1p for qemu-devel@nongnu.org; Thu, 20 Oct 2022 12:26:28 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:41887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olYNF-0006z7-4s for qemu-devel@nongnu.org; Thu, 20 Oct 2022 12:26:26 -0400 Received: from lenovo-t14s.redhat.com ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MgARS-1pKK672cfe-00hbnZ; Thu, 20 Oct 2022 18:26:13 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Paul Durrant , Markus Armbruster , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Dr. David Alan Gilbert" , Greg Kurz , Stefano Stabellini , David Gibson , Eric Blake , xen-devel@lists.xenproject.org, "Michael S. Tsirkin" , Stefan Weil , Paolo Bonzini , Jason Wang , Laurent Vivier , Samuel Thibault , Anthony Perard , Stefano Brivio Subject: [PATCH v13 07/17] net: socket: Don't ignore EINVAL on netdev socket connection Date: Thu, 20 Oct 2022 18:25:48 +0200 Message-Id: <20221020162558.123284-8-lvivier@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221020162558.123284-1-lvivier@redhat.com> References: <20221020162558.123284-1-lvivier@redhat.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:jVbH98dBD8KCQu3CflYYf2WHK6IxNZTn8SOKftQzM6rYbMt841f umYZfb7DOiy9WszJBh5jO14Kod8PpmW/LMWjAEhTG9s8N6WLoQOySO0cu8lrpfGZnjoMBNZ lRicfqi3QkfVzU8bONwOtd3cm8/J59uUX5+ddhDbODqQUvcOCI4/mZ1ldMR3H3UUvvzvisa jlIz6tChZQAVypz1IeUiA== X-UI-Out-Filterresults: notjunk:1;V03:K0:YM+4D1cBfxQ=:vycxjoJM7Ia1VeW2HyVOwH W6QgqHlOPjLlQWc8GajF3WmkpK3wnG3PkcSsmO1pCdWI7MIBwRFpM+hDgfJ7QbmU1cNVu3fqz 5WAVsO3WNCiyTjpqXHvwAz9WqZ9GB5oNhyrOBa/p1JgVeH5DLksoWrawAtAS/d1iZpPPm4yTF Yd4wxkIT0Y5xdeSJ1qwjBzLF3TiVRndY40YJJimxZB+HxWoW3Egoddz7wJQNilm1aWbC6R12C GhqRbJMOBcFj251iMF8WaEkaWKtCMMoPQqlJ5GIbpJq9SX4FDlorLY5aGtue5AAWUwCU9F1II POwt2p/JgYq1EuJNaFow7n8gORROcXJspu0b9LYb9e/vajQmijkn5uXEaY5+f8v56ydt2u8XL iVXJnRY6vb1Sl5SCgnB4pQIhT0mAeQ+eQ8VDpcmKqGhjuw3LaDLwSX2Qvz5pVyDFju8YNhwDQ yLEwFBtcOSTcQlVf4T2GjQzjI5DvDxbzL/qUrM8N2VTAarbgGJD6glMvfQlxFmLNz4TdbUZWX yZ9OxdjH9R9ghYt3h52qycfhePeEf5xMYnqirW+JnJD3bpeolBWFuNGslSXGmdu9wwuFlnnI+ S4C9U5knh7kT4zVbY+Y4AzouZLUgBIOeFeSaYTWtwNPQaX0ZtTTh+NpqCJCEG0MZlwnIjaZ8N T6FHzCK2zK+GA7aDJacjGwmgUpFxAWiSiHI/SGUqoenK/NjeQGxakyAiJIq+6joel7NGAHKPP 3E4zR0vkp2VIKsr6zVUL30GaLRYmUrYcYnxcAgwC6Fy3eNa9815fvBpOnz4wgJUwHXQdTQoNk +BKz8NR Received-SPF: permerror client-ip=212.227.126.135; envelope-from=lvivier@redhat.com; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_FAIL=0.001, SPF_HELO_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Stefano Brivio Other errors are treated as failure by net_socket_connect_init(), but if connect() returns EINVAL, we'll fail silently. Remove the related exception. Signed-off-by: Stefano Brivio Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Acked-by: Michael S. Tsirkin --- net/socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/socket.c b/net/socket.c index ade1ecf38b87..4944bb70d580 100644 --- a/net/socket.c +++ b/net/socket.c @@ -577,8 +577,7 @@ static int net_socket_connect_init(NetClientState *peer, if (errno == EINTR || errno == EWOULDBLOCK) { /* continue */ } else if (errno == EINPROGRESS || - errno == EALREADY || - errno == EINVAL) { + errno == EALREADY) { break; } else { error_setg_errno(errp, errno, "can't connect socket");