From patchwork Wed Jan 20 19:53:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1429417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=) 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 ozlabs.org (Postfix) with ESMTPS id 4DLbrz256cz9sVX for ; Thu, 21 Jan 2021 06:57:07 +1100 (AEDT) Received: from localhost ([::1]:59854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2JbE-0005ey-CY for incoming@patchwork.ozlabs.org; Wed, 20 Jan 2021 14:57:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXl-0001zV-Ve for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:30 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:40865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JXi-000303-4x for qemu-devel@nongnu.org; Wed, 20 Jan 2021 14:53:29 -0500 Received: from localhost.localdomain ([82.252.149.54]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M9Ezx-1l8evc178J-006Kos; Wed, 20 Jan 2021 20:53:23 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/5] linux-user: add missing UDP get/setsockopt option Date: Wed, 20 Jan 2021 20:53:14 +0100 Message-Id: <20210120195317.84222-3-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210120195317.84222-1-laurent@vivier.eu> References: <20210120195317.84222-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Ds0ty491rqaxPe7S1hdn37l/g9D89NRGntnS/utNubqsvs2JImt 084IRJo8NVBY3rnSqGfFpDPlUvLvgDQMTAnbjS5p36qo5lVn0jmc/zVqpZX31K+6UZubtCo ydtBQnMJNurz0PPuE8kM78NSSReIn7QkQPpp/sZU50Sz0I0ILKq0StJDgyLe6PaZnj2SRcg +Znn0M7t/rpSh6Up00IqQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:dGWcFPmxJ+w=:hpVXDvosoPBWYX5RUgxVbo Z3NIfQR6x7Ap6PbsrevrSWbPCDja92BwT9a/1Wt8cLtf5x4wuJ7upySUvWlNBcKUn80ZpRcX0 qWEOxoe70kEeJNaNRJDRUE7FHdLKO1k/6BCZumGp2Dwgddi6s2kUokn+J++mYttSTBxrS30Kq JWg8UbLXOAQ+p15SDU1P3khQd27TE9ns0bKAFd3JR49GBRvuMbgalfTzsaDsDJf6d+HmGzngU y2R5Qv22aag+MXCpQUI0iFQYQgwYXEOJpzJ489an0BTI4IqZzeZEzZWTHXvplue3OtPpr7EA0 IBkuKJe42uoM4luFaUrfg4psKqUurzWhTGaSQJ0pZdsIGXq43SAMJ0Qt2S/6bADggGD8JjjhA kK8hlT4FAOaFLQkLBvV+yLXL1yHx3MjIlCil3OejoiduJ8q2JNdOjkKMRFHleHxms4SORPieK VShbkSulgw== Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; 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_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Shu-Chun Weng Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Shu-Chun Weng SOL_UDP manipulate options at UDP level. All six options currently defined in linux source include/uapi/linux/udp.h take integer values. Signed-off-by: Shu-Chun Weng Reviewed-by: Laurent Vivier Message-Id: <20201218193213.3566856-3-scw@google.com> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 6 ++++++ linux-user/syscall.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 227812c07e63..64172de99d98 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -2644,6 +2645,11 @@ static void do_print_sockopt(const char *name, abi_long arg1) print_raw_param(TARGET_ABI_FMT_ld, optname, 0); print_pointer(optval, 0); break; + case SOL_UDP: + qemu_log("SOL_UDP,"); + print_raw_param(TARGET_ABI_FMT_ld, optname, 0); + print_pointer(optval, 0); + break; case SOL_IP: qemu_log("SOL_IP,"); print_raw_param(TARGET_ABI_FMT_ld, optname, 0); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 98aaca01872f..969db2008104 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -53,6 +53,7 @@ //#include #include #include +#include #include #include #include @@ -2184,7 +2185,8 @@ static abi_long do_setsockopt(int sockfd, int level, int optname, switch(level) { case SOL_TCP: - /* TCP options all take an 'int' value. */ + case SOL_UDP: + /* TCP and UDP options all take an 'int' value. */ if (optlen < sizeof(uint32_t)) return -TARGET_EINVAL; @@ -2832,7 +2834,8 @@ get_timeout: } break; case SOL_TCP: - /* TCP options all take an 'int' value. */ + case SOL_UDP: + /* TCP and UDP options all take an 'int' value. */ int_case: if (get_user_u32(len, optlen)) return -TARGET_EFAULT;