From patchwork Thu Oct 20 09:16:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13012941 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 703E9C4332F for ; Thu, 20 Oct 2022 10:01:10 +0000 (UTC) Received: from localhost ([::1]:43978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olSMO-000477-15 for qemu-devel@archiver.kernel.org; Thu, 20 Oct 2022 06:01:09 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olRmy-0007my-BH for qemu-devel@archiver.kernel.org; Thu, 20 Oct 2022 05:24:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olRfb-0002kx-RC for qemu-devel@nongnu.org; Thu, 20 Oct 2022 05:16:56 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:53927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olRfZ-0005IX-4T for qemu-devel@nongnu.org; Thu, 20 Oct 2022 05:16:55 -0400 Received: from lenovo-t14s.redhat.com ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mqrs9-1pOv8d47e5-00mok3; Thu, 20 Oct 2022 11:16:43 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , xen-devel@lists.xenproject.org, Eric Blake , Stefano Stabellini , Paolo Bonzini , Greg Kurz , Jason Wang , Anthony Perard , Thomas Huth , David Gibson , "Michael S. Tsirkin" , Laurent Vivier , Samuel Thibault , "Dr. David Alan Gilbert" , Paul Durrant , Stefan Weil , Markus Armbruster , Stefano Brivio Subject: [PATCH v12 07/17] net: socket: Don't ignore EINVAL on netdev socket connection Date: Thu, 20 Oct 2022 11:16:14 +0200 Message-Id: <20221020091624.48368-8-lvivier@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221020091624.48368-1-lvivier@redhat.com> References: <20221020091624.48368-1-lvivier@redhat.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:pTG9mgQH3OneQJT9lW8xR+6jyWFloNcXokaNuuau/BeQMn6894i QvLR9uWEG6mcjv8jh1WeG1Wk8Uk05xDnFHRgtDphQALVaQ4GEIer3NLtBRjIsQ5v8BP9UZm 6EIngEz80lfi3mRLNnzz6kcZD2jMQzS2Q7SKlOTxy0woczVUAJRrDtix8t6TJ7UnvYuW7bP WlH7sRJV8IwOy+5xFCtUg== X-UI-Out-Filterresults: notjunk:1;V03:K0:QgXbyh6xtH0=:cEThxxYGl8M0XF54eH8+EJ 1bz8h1K66qwNDz3xfDjEBZ0Q+FQoTUiFO4lcNsMNjTXuwyt9s/qAT7gyekUfyoNx2tAUMFEBf E5OMrbzY5poJCPUxshsWAzZKXaHzZ33Q5LWyrgziInxZp6fiDWra2nn+rDNJlfvW88oKjlqqN jUsF4k+xdpN26WVqsYBOAcyA5VFCv54jiW4M8vyDS+KE9Cg0bbndTXMbBR0QyezAhJ+jDp+dG Y6YEjUdMI6RCjh8Xf/Nx/+onlTQpAkFqDRLoS816DA3CacEHCzJmkIjd1u10f9CKFiHXPo8ge 2h0CA+gSTL7A602YNk0f+X+A196U3kwK8RMuKFNVf0Gpj+QBMtaDoUKIEBpOAO43yZqVtZV87 +T6w+wFOj/1EEs9dKugz1bpR6Geu20UtbRHOIxAsi4eRe0T4xseJ36tsn9Bj5usIJFbGd5Lgy jwtf1mAF+YdIV+eXEpGUtOuuGN35tvYaerZtRjgJ0VwucCHTcAJqH1W88M7bMUCNfrmg99HVV hXY6tszD5cHSb24h6qxkdHGZ7aPz/wV4QpfSgJwzKQG3mdKHhz1OrV8EgDaMMUlrKdvhx3c7O IVrxOhKo10TtzYxWzmWvfZmrZoUTjgStAi+BaCjPZUOihqeYaRlwm8BuPh60Zfz0FwIUrvXBy nMhIzdj8Ohjn+mwJj+rHu7jyG23Z1u3k7kIUuqIEFQAKIExePShcAwyvu8ioczMK2RF8x6Ug1 O43q3X7za6ZBoLqAqtPzkcdSdly+o1XEdfLBw1FFe1Z4PzuA9B5pAXgAjyc3jPwXvmWwILCPr q59iu+2 Received-SPF: permerror client-ip=212.227.126.187; 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");