From patchwork Tue Oct 11 20:05:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 13004322 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 79B6CC433F5 for ; Tue, 11 Oct 2022 20:32:08 +0000 (UTC) Received: from localhost ([::1]:47386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiLv5-0001zR-6K for qemu-devel@archiver.kernel.org; Tue, 11 Oct 2022 16:32:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiLVy-0006PQ-FR for qemu-devel@nongnu.org; Tue, 11 Oct 2022 16:06:19 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:35899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiLVu-0003kl-Vt for qemu-devel@nongnu.org; Tue, 11 Oct 2022 16:06:09 -0400 Received: from lenovo-t14s.redhat.com ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mzyi6-1p3bSX1O22-00x1UI; Tue, 11 Oct 2022 22:05:55 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Stefano Stabellini , =?utf-8?q?Daniel_P=2E_Berra?= =?utf-8?q?ng=C3=A9?= , "Dr. David Alan Gilbert" , Jason Wang , "Michael S. Tsirkin" , Paolo Bonzini , Anthony Perard , Greg Kurz , Eric Blake , Laurent Vivier , Stefan Weil , Thomas Huth , Samuel Thibault , Markus Armbruster , Paul Durrant , David Gibson , xen-devel@lists.xenproject.org, Stefano Brivio Subject: [PATCH v11 07/17] net: socket: Don't ignore EINVAL on netdev socket connection Date: Tue, 11 Oct 2022 22:05:29 +0200 Message-Id: <20221011200539.1486809-8-lvivier@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221011200539.1486809-1-lvivier@redhat.com> References: <20221011200539.1486809-1-lvivier@redhat.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:s2d3Wu4MO8ol5DA6PF+FwRX2ngxklqX0Xg022HDVmevHfVNwSNH wNVip7KNnUp+1d6oD/lzE6UuU2ptIv0OUC+VJvfArwZSeHBalDq3QRxn9aursvew6XDrERc /dOp3LLGjARYN3oHDHZXdNFQvCtZZd07alTYAPeSy3wuoB56esM4Fv5u6IVhrkMxXYcxKpa 5jTmu3R9fuCPRsqmZtIZg== X-UI-Out-Filterresults: notjunk:1;V03:K0:SsKt/PrHzOg=:RxXaAGqCcFTPq1Ui9f+XFu QvGhxbqWiHZ93SyVG59hGfTFa1pHKN7gxx4s5r1HazWDiCTWTqZgh1JOM0QjIAR2qVAIawO74 F7UFf6X3vvQNZmy+cnbJMOfIW7FgvOG815DFO7IS5d8/1Jw9pEul+1jvw4SwyO7VYV1eNwjaz IDVf0LhI6rd8Y9lyKnHLrpSNIjooJYTeKyX8MhDgo5sR2BLGcNhqShiBbhB8mWeWw86NVVVhG rgKaUMU+P32b/fJ/xa0WqGa2ItdRfC9bpPhsmEhDwvFIeF7N5tNyNvWiK5YeDeAZ94KkLF5uK d6jkLKfETNs4Ist6FIMRTFs5Y1FliJ89R0cQ0/tagOcH998wYfIHWnM+z4YW9GTIxuJkUBR6F DWgGoHApOkSVQOwAb4p9vXeDhb/rdG8tgIy+3KhZYINESx5/0aL4miBAGAR6DyHYxG6vXqvqP e+Ah0OpluVNIb8ZLX6HrTZo4ITr9BnY5dbZpIOUWRXe36VIMxgX5lv8uDd3zvvsbHpZQe69Z/ txcFYbX4pBEYiu/19N+ZA5KddJlT+Qwp15ra9W5TJnZ2qyfgCWtjj2sjpdB87I6nOY9vr4hYw 2FBt0nOoWsD78F59XD6keFsE0sjo/b2xghk7A8K7wdkc2OI0BbIqmTVQQpykGTToyADJrGStn G997YVCvjhsCW/gyu7Fysj+2TXtFAuStHpH3Uadyaoqu8Ryc+aj5SHWMDlDn2ZDlSAXkGRBQj Yk2lf8kSWc7wJ+EJI5OuHXPeQXUqsZ1/ZXu+tmH0LtiU2SBZUUBQW6ac6rdFAW93/MfhicUoz fmWAe+T Received-SPF: permerror client-ip=212.227.126.134; 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");