From nobody Sat Apr 5 05:31:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1737723919; cv=none; d=zohomail.com; s=zohoarc; b=EPNtmSJwj8ubI4IDiseWQf59eRZL+ObrLhQJVRizV/Ff1PH1cDYDzC/PslqA7vNw/MM6zLHkqJAHzo6BsRgyPPVxW6tWce1WqX4qScx0j+A5lLTalucGhXfhF9s1P5D89oHmkNXiva5ibRHG1FIsXnFxiGxBHlCJu2UzegEr7Co= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737723919; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WNXz3Kw9fr40tc2jvUorbYvGmuPCmcuTMcpLQAXk9ko=; b=dGaiN/9DORg3i6smmYjbADfuApZdjtJlr/C99iCUknzGOem5Ggd6YNTBy4GF+hM4G3qwCGp45pTL5uHN2M4gavz14J24D0TyEYtJS7FzGuo6HpOOfXrX0C7+D1KbnJJkeRDn9w1q0u/Sv+vMsLx0rXombk0HT2j0BTN+U7Ahksc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737723919197920.6684431640841; Fri, 24 Jan 2025 05:05:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbJLK-0000Sw-LM; Fri, 24 Jan 2025 08:03:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJKy-0000OU-D5 for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:05 -0500 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJKw-0007G9-NX for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:04 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id F13335C5A69; Fri, 24 Jan 2025 13:02:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91F5AC4CEE0; Fri, 24 Jan 2025 13:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737723780; bh=0dCMgv3HdlrGef/55pmBNQDksmQaq+s2c+t9E36FqCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cs0kJaSyrWMz36F1Au/9USwvNrXgQpp3NQq/G5+wT4XDRhhhhJsLia2zK29rHtKcI 5ryhg8+NoqqO+SLtkSWLtK8x9OHgzCBZH5QjKg+P2PFZdgjtakcROuEoNzYlLnV6w/ PN6DkGPY1cYqUyeJbakeaUdTsjj1Nq/oCV+o1dQBUwiZTwku4/4aVMesluIYL4JkIv 00ZMtIhuKidxeEfqD9Eej2pV0oeiz70jdLoaxOgyJQXgyupec6IFBAjf1ODb/s2Sn9 luvePZCl0Ie+dqdbwv1t5QouWEFysRpkJOjL5sLCXMQQOrPLX/wXVEor1mXJ3w3Nef ibCY9lG8QB44g== From: deller@kernel.org To: Laurent Vivier , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PULL v3 1/6] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr() Date: Fri, 24 Jan 2025 14:02:49 +0100 Message-ID: <20250124130254.3134-2-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250124130254.3134-1-deller@kernel.org> References: <20250124130254.3134-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -73 X-Spam_score: -7.4 X-Spam_bar: ------- X-Spam_report: (-7.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1737723921606019100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Fix this warning: Unknown host IFA type: 11 While adding IFA_PROTO, convert all IFA_XXX values over to QEMU_IFA_XXX val= ues to avoid a build failure on Ubuntu 22.04 (kernel v5.18 which does not know IFA_PROTO yet). Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier --- linux-user/fd-trans.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index c04a97c73a..2e714c8e56 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -31,6 +31,22 @@ #include "fd-trans.h" #include "signal-common.h" =20 +enum { + QEMU_IFA_UNSPEC, + QEMU_IFA_ADDRESS, + QEMU_IFA_LOCAL, + QEMU_IFA_LABEL, + QEMU_IFA_BROADCAST, + QEMU_IFA_ANYCAST, + QEMU_IFA_CACHEINFO, + QEMU_IFA_MULTICAST, + QEMU_IFA_FLAGS, + QEMU_IFA_RT_PRIORITY, + QEMU_IFA_TARGET_NETNSID, + QEMU_IFA_PROTO, + QEMU__IFA__MAX, +}; + enum { QEMU_IFLA_BR_UNSPEC, QEMU_IFLA_BR_FORWARD_DELAY, @@ -1138,20 +1154,21 @@ static abi_long host_to_target_data_addr_rtattr(str= uct rtattr *rtattr) =20 switch (rtattr->rta_type) { /* binary: depends on family type */ - case IFA_ADDRESS: - case IFA_LOCAL: + case QEMU_IFA_ADDRESS: + case QEMU_IFA_LOCAL: + case QEMU_IFA_PROTO: break; /* string */ - case IFA_LABEL: + case QEMU_IFA_LABEL: break; /* u32 */ - case IFA_FLAGS: - case IFA_BROADCAST: + case QEMU_IFA_FLAGS: + case QEMU_IFA_BROADCAST: u32 =3D RTA_DATA(rtattr); *u32 =3D tswap32(*u32); break; /* struct ifa_cacheinfo */ - case IFA_CACHEINFO: + case QEMU_IFA_CACHEINFO: ci =3D RTA_DATA(rtattr); ci->ifa_prefered =3D tswap32(ci->ifa_prefered); ci->ifa_valid =3D tswap32(ci->ifa_valid); @@ -1398,8 +1415,8 @@ static abi_long target_to_host_data_addr_rtattr(struc= t rtattr *rtattr) { switch (rtattr->rta_type) { /* binary: depends on family type */ - case IFA_LOCAL: - case IFA_ADDRESS: + case QEMU_IFA_LOCAL: + case QEMU_IFA_ADDRESS: break; default: qemu_log_mask(LOG_UNIMP, "Unknown target IFA type: %d\n", --=20 2.47.0 From nobody Sat Apr 5 05:31:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1737723926; cv=none; d=zohomail.com; s=zohoarc; b=I94D2rofK3bUyvSzBDxqldkJNHIigF7TxnWMEaaXllNL/hstLjfhxf67SO+FTTuUCiLz4JMI6mdiTY64g9PiQUWBSX4xOxHRbmGS9vBFQFI25um5vGC/PCHHV78EYttRGP9YxHm6x3rDn7b/sCREVOi7AAek0Pz175VtdMg/S6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737723926; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RBDqbv36d7rMU7mYNOQTbjQXNZ6ueYYWCeGW74FJuak=; b=jrx/z16szMUq3uKXTBp5x1eJKm2LytwcDGzR57ol0eiCvannvEacyPgQAFNBxqeQ3z9wXS7pLkB12tcFzrvZMiuM9l+sMLZ2k4rH2miY81XpNM32QdWkfxASjyk+iZzvRx8oY3lcyvBFgx4FRCqmoqXRwJZ+ruvsudgfzAIS2s8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737723926794132.44901624127442; Fri, 24 Jan 2025 05:05:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbJLS-0000To-3J; Fri, 24 Jan 2025 08:03:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJKz-0000Ox-Mi for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:07 -0500 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJKx-0007GG-5A for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:05 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C8CE15C5B68; Fri, 24 Jan 2025 13:02:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6649EC4CED2; Fri, 24 Jan 2025 13:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737723781; bh=f4X9zMW2UNRK6C5YvFLwtVaulKW3SQq3pLWgREWOxYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zcnn+5+mrMMfXf76PztBcaCVPnjvYdMxwwTjI0iHkY+ebE4WQcvAHv2U3tdeRsNuM +5S1dMjxNH3Kg7P/1ps0Q9GE0uPtiUvOMAewaeAL7om5ZsHej+bHsdkfCaIGL5Voul 1B9YQhFsbLZnO828dZq93ilgK4p/i437LBdCxDiHLhWfhkcE6xgQhequcqldXx898E +1lBuTBsM45YflB3OhtPssvF3sr5EBFNc+OvSOazAPijqMVcxZ18sBCfNjUfQTDNwG GWxVrUFWO4brChFkYyIcKCEN/H0PrsOwbijJWckZmPM6OG9B5qdeA9LKuKNtJAd3e2 i0Q930x+V7M0Q== From: deller@kernel.org To: Laurent Vivier , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PULL v3 2/6] linux-user: Use unique error messages for cmsg parsing Date: Fri, 24 Jan 2025 14:02:50 +0100 Message-ID: <20250124130254.3134-3-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250124130254.3134-1-deller@kernel.org> References: <20250124130254.3134-1-deller@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -73 X-Spam_score: -7.4 X-Spam_bar: ------- X-Spam_report: (-7.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1737723930477019000 From: Helge Deller Avoid using the same error message for two different code paths as it complicates determining the one which actually triggered. Signed-off-by: Helge Deller Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 78c7c0b34e..a157abc40c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1827,7 +1827,7 @@ static inline abi_long target_to_host_cmsg(struct msg= hdr *msgh, *dst =3D tswap32(*dst); } } else { - qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n", + qemu_log_mask(LOG_UNIMP, "Unsupported target ancillary data: %= d/%d\n", cmsg->cmsg_level, cmsg->cmsg_type); memcpy(data, target_data, len); } @@ -2049,7 +2049,7 @@ static inline abi_long host_to_target_cmsg(struct tar= get_msghdr *target_msgh, =20 default: unimplemented: - qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n", + qemu_log_mask(LOG_UNIMP, "Unsupported host ancillary data: %d/= %d\n", cmsg->cmsg_level, cmsg->cmsg_type); memcpy(target_data, data, MIN(len, tgt_len)); if (tgt_len > len) { --=20 2.47.0 From nobody Sat Apr 5 05:31:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1737723962; cv=none; d=zohomail.com; s=zohoarc; b=jiiKw1pY1W5fxeMR6d7riuy7eG+G+jfxDCiKAkKQz63VMe6X/kFaKLv9opHnORxyCuUARBxNQYx4eJxMI5wZRHqMk4ogS76Tb7obYNmpwXHvrhw0nnkPwBwmwWINkBhoFLGOVQb7M+30rP+uXPoPFE/GfHjoZdBNQiu1ZQz1zO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737723962; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fWx5CAuIBbJDfLzvJwb7YQTA2cvjlafVdk+7wlslSCs=; b=NeOCodNFo077ST3awk3nGTSXLlOCrxfRVw/FGx05oqPKC55wz7YLAt3q4AfxZRDwusFlCpmcF3EQ72x2B1NS1oY14VnBx+4WCoJEcMrHx7ZRAfrQHUDmnNcj1m38nfIcFsRjLnLJ9UM1lQUh2SX5V7nXgePQrVjAA8G9SX9Jl7k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17377239620074.0377597567469365; Fri, 24 Jan 2025 05:06:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbJLe-0000cs-59; Fri, 24 Jan 2025 08:03:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJL2-0000Pm-PG for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:12 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJKz-0007GU-EA for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:06 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 732615C5B9E; Fri, 24 Jan 2025 13:02:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DEE1C4CED2; Fri, 24 Jan 2025 13:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737723783; bh=ccz5LM+xc8j0WKFoIHGpIfYu4qedCCNtwYrf+iuAPzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IJ193hcCoVk4LgMPWOxXhAOQV6/KEUyg+llxaRl/79mVwst4Y93tLza9OwcrQM5Ud wrlzGwsAmKsMMis7M67FVwmr3WNg3dy5YCxAxn7TsW166qZVyAAymHrARbXiqwxUGz tI8eTqOa27ulAPn4PnGjJjpHTt8J6f3j0OA8EXmVH2yi7hQqXa8Ao9f8Cm8IFDSf+h o0RpAiqRHmApDG0luumRdXJnsDNgO+oSTRdEmsBbagowzafZpdL/FP8cjbDbD9eMQu mbAMe/QYxtHWuT3tjw9XwivAA1IIn3IxGO7FSc1zhyfMPP+4o1kqSliDu/o9LVF8sk 8hTOFbcx4Z8bQ== From: deller@kernel.org To: Laurent Vivier , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PULL v3 3/6] linux-user: netlink: Add IP_PKTINFO cmsg parsing Date: Fri, 24 Jan 2025 14:02:51 +0100 Message-ID: <20250124130254.3134-4-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250124130254.3134-1-deller@kernel.org> References: <20250124130254.3134-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=139.178.84.217; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -100 X-Spam_score: -10.1 X-Spam_bar: ---------- X-Spam_report: (-10.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1737723963759019000 Content-Type: text/plain; charset="utf-8" From: Helge Deller Fixes those warnings: Unsupported host ancillary data: 0/8 Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 10 ++++++++++ linux-user/syscall_defs.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a157abc40c..df8609b4d8 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1998,6 +1998,16 @@ static inline abi_long host_to_target_cmsg(struct ta= rget_msghdr *target_msgh, (void *) &errh->offender, sizeof(errh->offender)); break; } + case IP_PKTINFO: + { + struct in_pktinfo *pkti =3D data; + struct target_in_pktinfo *target_pi =3D target_data; + + __put_user(pkti->ipi_ifindex, &target_pi->ipi_ifindex); + target_pi->ipi_spec_dst.s_addr =3D pkti->ipi_spec_dst.s_ad= dr; + target_pi->ipi_addr.s_addr =3D pkti->ipi_addr.s_addr; + break; + } default: goto unimplemented; } diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index faad9147c9..86d773add7 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2622,6 +2622,12 @@ struct target_ucred { abi_uint gid; }; =20 +struct target_in_pktinfo { + abi_int ipi_ifindex; + struct target_in_addr ipi_spec_dst; + struct target_in_addr ipi_addr; +}; + typedef abi_int target_timer_t; =20 #define TARGET_SIGEV_MAX_SIZE 64 --=20 2.47.0 From nobody Sat Apr 5 05:31:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1737723918; cv=none; d=zohomail.com; s=zohoarc; b=X+nBb87FC2GR9Sr+3yREnpqflmYs5fccO20rRyHkbNBosWPEkPa1aR4+uy0yRRCeTIw2WlGc0T4gNzmNY6lETPp9kaqosEAGPM8Z66xAU3KT3YSzR0bgA4jUuLat67p9NDHo694m/tVLc8EmJSietdMt2cKw+uDjsw9E2JbAykU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737723918; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0UrhhDP5Sg7utw1R3CxPPJvWuKMMp8NxFLFpClElQ+o=; b=Yy6xBTbA4pG2pWjfmAMZs/WdbLC9ANmgeHJeZLgz8xXXQg4p1EHEzOVSnOwzD/dNFj7k1MwyNri55TA+BY5AIAqRgb/aoiUn75VTc0HCEtpDdzEAZbk8o0bck145VxIYyEwC8FHiUkKuaSccDgKrxOKaRgnbi9hl4SJi/C504Cw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737723918689373.16621241389566; Fri, 24 Jan 2025 05:05:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbJLU-0000Uv-Ar; Fri, 24 Jan 2025 08:03:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJL4-0000Pr-6O for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:14 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJL2-0007Gt-IZ for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:09 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 496B45C5A69; Fri, 24 Jan 2025 13:02:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD5E7C4CEE0; Fri, 24 Jan 2025 13:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737723785; bh=Ovgym6COY+4COyqSeNlwwKYtZTk/Tq2Ej2TcJmZIyic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A7PxC7LfDSa/F4FQbgHFx28DZamDkbymKY6YrTpCTCLD2kyO8iOjrnx7T+gebtY1y 1iZTbohzTslYsIWUsXvLiRj87j9L8mUSCXToOdsKG48Mdz9KXG10pZ31BEiWEUkfYR ORTD698Tt8Oem+6ZjPC2z0AxOBMihfD/NYg2NFbsiULjSQWaA58dhWCWx/sY+8ipZZ jxRUTm8tvbrAVFCM2S7jYKrnyy8XanJbnb/YTdHD67SjBMrXvYOyjCIluQE8RGuhug u+z8+q3hPBXxPxHltrWsGF2N5RQZFuZOwIbwFEoC8k0aJmIWcND+zErovZYz1F4QaC N1WAmr1D6x+Pw== From: deller@kernel.org To: Laurent Vivier , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PULL v3 4/6] linux-user: netlink: Add emulation of IP_MULTICAST_IF Date: Fri, 24 Jan 2025 14:02:52 +0100 Message-ID: <20250124130254.3134-5-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250124130254.3134-1-deller@kernel.org> References: <20250124130254.3134-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=139.178.84.217; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -100 X-Spam_score: -10.1 X-Spam_bar: ---------- X-Spam_report: (-10.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1737723921811019100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Add IP_MULTICAST_IF and share the code with IP_ADD_MEMBERSHIP / IP_DROP_MEM= BERSHIP. Sharing the code makes sense, because the manpage of ip(7) says: IP_MULTICAST_IF (since Linux 1.2) Set the local device for a multicast socket. The argument for setsockopt(2) is an ip_mreqn or (since Linux 3.5) ip_mreq structure similar to IP_ADD_MEMBERSHIP, or an in_addr structure. (The kernel determines which structure is being passed based on the size passed in optlen.) For getsockopt(2), the argument is an in_addr structure. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index df8609b4d8..6ee02383da 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2130,16 +2130,23 @@ static abi_long do_setsockopt(int sockfd, int level= , int optname, } ret =3D get_errno(setsockopt(sockfd, level, optname, &val, siz= eof(val))); break; + case IP_MULTICAST_IF: case IP_ADD_MEMBERSHIP: case IP_DROP_MEMBERSHIP: { struct ip_mreqn ip_mreq; struct target_ip_mreqn *target_smreqn; + int min_size; =20 QEMU_BUILD_BUG_ON(sizeof(struct ip_mreq) !=3D sizeof(struct target_ip_mreq)); =20 - if (optlen < sizeof (struct target_ip_mreq) || + if (optname =3D=3D IP_MULTICAST_IF) { + min_size =3D sizeof(struct in_addr); + } else { + min_size =3D sizeof(struct target_ip_mreq); + } + if (optlen < min_size || optlen > sizeof (struct target_ip_mreqn)) { return -TARGET_EINVAL; } @@ -2149,13 +2156,14 @@ static abi_long do_setsockopt(int sockfd, int level= , int optname, return -TARGET_EFAULT; } ip_mreq.imr_multiaddr.s_addr =3D target_smreqn->imr_multiaddr.= s_addr; - ip_mreq.imr_address.s_addr =3D target_smreqn->imr_address.s_ad= dr; - if (optlen =3D=3D sizeof(struct target_ip_mreqn)) { - ip_mreq.imr_ifindex =3D tswapal(target_smreqn->imr_ifindex= ); - optlen =3D sizeof(struct ip_mreqn); + if (optlen >=3D sizeof(struct target_ip_mreq)) { + ip_mreq.imr_address.s_addr =3D target_smreqn->imr_address.= s_addr; + if (optlen >=3D sizeof(struct target_ip_mreqn)) { + __put_user(target_smreqn->imr_ifindex, &ip_mreq.imr_if= index); + optlen =3D sizeof(struct ip_mreqn); + } } unlock_user(target_smreqn, optval_addr, 0); - ret =3D get_errno(setsockopt(sockfd, level, optname, &ip_mreq,= optlen)); break; } --=20 2.47.0 From nobody Sat Apr 5 05:31:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1737723836; cv=none; d=zohomail.com; s=zohoarc; b=KjL3Hdk+MCQnbNMuGMPNXwzzu7usTQZ0ys3pV0XjsVJr6EHzzDwaotlhixdqXFZH7IaadZNt6tsAVogN8Wu7TeMvdQyRAiW7Zwfmb7XOn820GAJ+LSbtFa/r9f7kEaONKV9B6aeeld2+d4DT1poq0nzfM2kxir/0ykZhXqoJTjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737723836; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oU/vqoo23DWKyAOA6ILy3ggBRdG7V0yuoUZdGtJDNbQ=; b=Qva9+vkAzmJ9l2o+Btw6MulPK1JyWgn2N3DHRKyKy4HkonCSP220ooET/0F6Ghz0bZ1bF0Qo/ZXUIVStyb7jVAozLhIxkhfSGJe6BAblXw34rbWrpVQrPHq4RqAWfM5NnrhmFd7UGxj9i27Al2jnehJHBfX48I2K+IFD3XGpjVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737723836269184.40243829484768; Fri, 24 Jan 2025 05:03:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbJLS-0000Tp-47; Fri, 24 Jan 2025 08:03:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJL4-0000Pt-Tb for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:14 -0500 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJL2-0007H3-Ig for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:10 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1E0DC5C5A81; Fri, 24 Jan 2025 13:02:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1A9BC4CED2; Fri, 24 Jan 2025 13:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737723787; bh=+SMT1Ka5Xy6fyDrlOIaRE9P42fAh6RoCdIztHWEYvfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xl44rBIsQ4y5CJ160FYg9QT5IAPTMETvBBZX7aK8jFPSukKQWZwppOYeRfbclJIgo 55NW8qHeXfeWrnGw6zV8YVf+JKp7zDNchO8AfD0EkJwE3FH3cNei4cAU6FrxaBI3es uTOgLYr8plc4Xom/AMVsIwNbPZBsh5rqxjO4rlS025WCvVbEHROi0XNuSGuUg979SI ltyrek+FCa/iODyqei3AOUvpa2gQjgZ0F6W6MVislxUlI7ZWrYiASK3Z31uvIwChcx jVd7vyR4qGWAwCWO4jS7R5xW3mvUcNROjbLJJJlgszfgKBph6U/F6UHDWTSQGXHAFz Gc6hqb3obytzQ== From: deller@kernel.org To: Laurent Vivier , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PULL v3 5/6] linux-user: netlink: add netlink neighbour emulation Date: Fri, 24 Jan 2025 14:02:53 +0100 Message-ID: <20250124130254.3134-6-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250124130254.3134-1-deller@kernel.org> References: <20250124130254.3134-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -73 X-Spam_score: -7.4 X-Spam_bar: ------- X-Spam_report: (-7.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1737723839728019100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Fixes various warnings in the testsuite while building gupnp: gssdp-net-DEBUG: Failed to send netlink message: Operation not supported gupnp-context-DEBUG: Mismatch between host header and host IP (example.com= , expected: 127.0.0.1) gupnp-context-DEBUG: Mismatch between host header and host port (80, expec= ted 4711) gupnp-context-DEBUG: Mismatch between host header and host IP (192.168.1.2= , expected: 127.0.0.1) gupnp-context-DEBUG: Mismatch between host header and host IP (fe80::01, e= xpected: 127.0.0.1) gupnp-context-DEBUG: Mismatch between host header and host port (80, expec= ted 4711) gupnp-context-DEBUG: Failed to parse HOST header from request: Invalid IPv= 6 address ?[fe80::01%1]? in URI gupnp-context-DEBUG: Failed to parse HOST header from request: Invalid IPv= 6 address ?[fe80::01%eth0]? in URI gupnp-context-DEBUG: Failed to parse HOST header from request: Could not p= arse port ?:1? in URI gupnp-context-DEBUG: Mismatch between host header and host IP (example.com= , expected: ::1) gupnp-context-DEBUG: Mismatch between host header and host port (80, expec= ted 4711) gupnp-context-DEBUG: Mismatch between host header and host IP (example.com= , expected: ::1) gupnp-context-DEBUG: Mismatch between host header and host port (80, expec= ted 4711) gupnp-context-DEBUG: Mismatch between host header and host IP (example.com= , expected: ::1) Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier --- linux-user/fd-trans.c | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 2e714c8e56..621e2248b4 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -25,12 +25,16 @@ #ifdef CONFIG_RTNETLINK #include #include +#include #endif #include "qemu.h" #include "user-internals.h" #include "fd-trans.h" #include "signal-common.h" =20 +#define NDM_RTA(r) ((struct rtattr*)(((char*)(r)) + \ + NLMSG_ALIGN(sizeof(struct ndmsg)))) + enum { QEMU_IFA_UNSPEC, QEMU_IFA_ADDRESS, @@ -1226,6 +1230,35 @@ static abi_long host_to_target_data_route_rtattr(str= uct rtattr *rtattr) return 0; } =20 +static abi_long host_to_target_data_neigh_rtattr(struct rtattr *rtattr) +{ + struct nda_cacheinfo *ndac; + uint32_t *u32; + + switch (rtattr->rta_type) { + case NDA_UNSPEC: + case NDA_DST: + case NDA_LLADDR: + break; + case NDA_PROBES: + u32 =3D RTA_DATA(rtattr); + *u32 =3D tswap32(*u32); + break; + case NDA_CACHEINFO: + ndac =3D RTA_DATA(rtattr); + ndac->ndm_confirmed =3D tswap32(ndac->ndm_confirmed); + ndac->ndm_used =3D tswap32(ndac->ndm_used); + ndac->ndm_updated =3D tswap32(ndac->ndm_updated); + ndac->ndm_refcnt =3D tswap32(ndac->ndm_refcnt); + break; + default: + qemu_log_mask(LOG_UNIMP, "Unknown host to target NEIGH type: %d\n", + rtattr->rta_type); + break; + } + return 0; +} + static abi_long host_to_target_link_rtattr(struct rtattr *rtattr, uint32_t rtattr_len) { @@ -1247,12 +1280,20 @@ static abi_long host_to_target_route_rtattr(struct = rtattr *rtattr, host_to_target_data_route_rtattr= ); } =20 +static abi_long host_to_target_neigh_rtattr(struct rtattr *rtattr, + uint32_t rtattr_len) +{ + return host_to_target_for_each_rtattr(rtattr, rtattr_len, + host_to_target_data_neigh_rtattr= ); +} + static abi_long host_to_target_data_route(struct nlmsghdr *nlh) { uint32_t nlmsg_len; struct ifinfomsg *ifi; struct ifaddrmsg *ifa; struct rtmsg *rtm; + struct ndmsg *ndm; =20 nlmsg_len =3D nlh->nlmsg_len; switch (nlh->nlmsg_type) { @@ -1279,6 +1320,17 @@ static abi_long host_to_target_data_route(struct nlm= sghdr *nlh) nlmsg_len - NLMSG_LENGTH(sizeof(*if= a))); } break; + case RTM_NEWNEIGH: + case RTM_DELNEIGH: + case RTM_GETNEIGH: + if (nlh->nlmsg_len >=3D NLMSG_LENGTH(sizeof(*ndm))) { + ndm =3D NLMSG_DATA(nlh); + ndm->ndm_ifindex =3D tswap32(ndm->ndm_ifindex); + ndm->ndm_state =3D tswap16(ndm->ndm_state); + host_to_target_neigh_rtattr(NDM_RTA(ndm), + nlmsg_len - NLMSG_LENGTH(sizeof(*ndm))= ); + } + break; case RTM_NEWROUTE: case RTM_DELROUTE: case RTM_GETROUTE: @@ -1426,6 +1478,35 @@ static abi_long target_to_host_data_addr_rtattr(stru= ct rtattr *rtattr) return 0; } =20 +static abi_long target_to_host_data_neigh_rtattr(struct rtattr *rtattr) +{ + struct nda_cacheinfo *ndac; + uint32_t *u32; + + switch (rtattr->rta_type) { + case NDA_UNSPEC: + case NDA_DST: + case NDA_LLADDR: + break; + case NDA_PROBES: + u32 =3D RTA_DATA(rtattr); + *u32 =3D tswap32(*u32); + break; + case NDA_CACHEINFO: + ndac =3D RTA_DATA(rtattr); + ndac->ndm_confirmed =3D tswap32(ndac->ndm_confirmed); + ndac->ndm_used =3D tswap32(ndac->ndm_used); + ndac->ndm_updated =3D tswap32(ndac->ndm_updated); + ndac->ndm_refcnt =3D tswap32(ndac->ndm_refcnt); + break; + default: + qemu_log_mask(LOG_UNIMP, "Unknown target NEIGH type: %d\n", + rtattr->rta_type); + break; + } + return 0; +} + static abi_long target_to_host_data_route_rtattr(struct rtattr *rtattr) { uint32_t *u32; @@ -1464,6 +1545,13 @@ static void target_to_host_addr_rtattr(struct rtattr= *rtattr, target_to_host_data_addr_rtattr); } =20 +static void target_to_host_neigh_rtattr(struct rtattr *rtattr, + uint32_t rtattr_len) +{ + target_to_host_for_each_rtattr(rtattr, rtattr_len, + target_to_host_data_neigh_rtattr); +} + static void target_to_host_route_rtattr(struct rtattr *rtattr, uint32_t rtattr_len) { @@ -1476,6 +1564,7 @@ static abi_long target_to_host_data_route(struct nlms= ghdr *nlh) struct ifinfomsg *ifi; struct ifaddrmsg *ifa; struct rtmsg *rtm; + struct ndmsg *ndm; =20 switch (nlh->nlmsg_type) { case RTM_NEWLINK: @@ -1502,6 +1591,17 @@ static abi_long target_to_host_data_route(struct nlm= sghdr *nlh) NLMSG_LENGTH(sizeof(*ifa))); } break; + case RTM_NEWNEIGH: + case RTM_DELNEIGH: + case RTM_GETNEIGH: + if (nlh->nlmsg_len >=3D NLMSG_LENGTH(sizeof(*ndm))) { + ndm =3D NLMSG_DATA(nlh); + ndm->ndm_ifindex =3D tswap32(ndm->ndm_ifindex); + ndm->ndm_state =3D tswap16(ndm->ndm_state); + target_to_host_neigh_rtattr(NDM_RTA(ndm), nlh->nlmsg_len - + NLMSG_LENGTH(sizeof(*ndm))); + } + break; case RTM_NEWROUTE: case RTM_DELROUTE: case RTM_GETROUTE: --=20 2.47.0 From nobody Sat Apr 5 05:31:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1737723948; cv=none; d=zohomail.com; s=zohoarc; b=Z+akg8zJkpWHHAoRqmY56PxQ41LZyzbUdYHYNlH7xt1Mix+zorccwKJ2BJzx/wSvvMvm5Ak9x8XWlP2a0kLk6QGcSLZX/PK8N/4MVReJWiQbHP2JvjXbfLQjc5jQ93FBYT9F13HVSfGUGmHnMuwlm8V5YlqtZLcvQkJpg74Mm9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737723948; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Xv0zxheg2bVfd/WjqH44ot+3aYJTgTAFhzyvIhwjXZE=; b=hcBeXZqR8QdGiNR5+3JlpU3z1IaTe3Jjc7vdHuGxrIHBKW+7vExsUcSiUjl5nICNh3aXnBN+tpoGGo0bu5hrZyyHnXB1FJk50smK4zMscEKYC8lf+Azr5yREtyQQX1bj55y1ucrb9JitMit7wctp9RFYEg+AixQTNIPLOavRy3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737723948235498.69939915259874; Fri, 24 Jan 2025 05:05:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbJLb-0000YY-4M; Fri, 24 Jan 2025 08:03:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJL7-0000QB-DJ for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:22 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbJL4-0007HE-0k for qemu-devel@nongnu.org; Fri, 24 Jan 2025 08:03:11 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EB2895C5B68; Fri, 24 Jan 2025 13:02:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8841DC4CED2; Fri, 24 Jan 2025 13:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737723788; bh=zy5MMDiEniOCI+VhkESuGBJphCnKoQgFwUB9VGk+qFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tPD6fhIygg8qzfyXDiUFDNKPTnVDC96WNPfHgSCAA/fV81exOJsf9FvP1fQMxYp1R KZZ2gMv3s6icILYal4IqiVx7ZLFxGVVVUGxSI2uVytiUtmtHqG8Bwybfq0FimNgUjz Dgt1/6/myEwk1OOcupWBopJfB8SBNi+GdYxwjG3KaBiAhPJXsiNYgs5RT9/BVioq7U 6Cr0W1s1ZNUW8b9fzTYaYFY2EDCbLajoWb/nhtLEGsQRZTsb9d+ewQ9BvDP6jR30oK qEBok8yju/LUr7ZhOXLD1ii5vnJe/5o9DTT6Y3iKgdB70DLrcZboGy+h4Zi731DuaH jB++S3Lfvb6rQ== From: deller@kernel.org To: Laurent Vivier , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PULL v3 6/6] linux-user: netlink: Add missing QEMU_IFLA entries Date: Fri, 24 Jan 2025 14:02:54 +0100 Message-ID: <20250124130254.3134-7-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250124130254.3134-1-deller@kernel.org> References: <20250124130254.3134-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=139.178.84.217; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -100 X-Spam_score: -10.1 X-Spam_bar: ---------- X-Spam_report: (-10.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1737723949731019000 Content-Type: text/plain; charset="utf-8" From: Helge Deller This fixes the following qemu warnings when building debian gupnp package: Unknown host QEMU_IFLA type: 61 Unknown host QEMU_IFLA type: 58 Unknown host QEMU_IFLA type: 59 Unknown host QEMU_IFLA type: 60 Unknown host QEMU_IFLA type: 32820 QEMU_IFLA type 32820 is actually NLA_NESTED | QEMU_IFLA_PROP_LIST (a nested entry), which is why rta_type needs to be masked with NLA_TYPE_MASK. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier --- linux-user/fd-trans.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 621e2248b4..f83d1f79d5 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -161,6 +161,14 @@ enum { QEMU_IFLA_PROTO_DOWN_REASON, QEMU_IFLA_PARENT_DEV_NAME, QEMU_IFLA_PARENT_DEV_BUS_NAME, + QEMU_IFLA_GRO_MAX_SIZE, + QEMU_IFLA_TSO_MAX_SIZE, + QEMU_IFLA_TSO_MAX_SEGS, + QEMU_IFLA_ALLMULTI, + QEMU_IFLA_DEVLINK_PORT, + QEMU_IFLA_GSO_IPV4_MAX_SIZE, + QEMU_IFLA_GRO_IPV4_MAX_SIZE, + QEMU_IFLA_DPLL_PIN, QEMU___IFLA_MAX }; =20 @@ -1002,6 +1010,22 @@ static abi_long host_to_target_data_vfinfo_nlattr(st= ruct nlattr *nlattr, return 0; } =20 +static abi_long host_to_target_data_prop_nlattr(struct nlattr *nlattr, + void *context) +{ + switch (nlattr->nla_type) { + /* string */ + case QEMU_IFLA_ALT_IFNAME: + break; + default: + qemu_log_mask(LOG_UNIMP, "Unknown host PROP type: %d\n", + nlattr->nla_type); + break; + } + return 0; +} + + static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) { uint32_t *u32; @@ -1010,7 +1034,7 @@ static abi_long host_to_target_data_link_rtattr(struc= t rtattr *rtattr) struct rtnl_link_ifmap *map; struct linkinfo_context li_context; =20 - switch (rtattr->rta_type) { + switch (rtattr->rta_type & NLA_TYPE_MASK) { /* binary stream */ case QEMU_IFLA_ADDRESS: case QEMU_IFLA_BROADCAST: @@ -1048,6 +1072,12 @@ static abi_long host_to_target_data_link_rtattr(stru= ct rtattr *rtattr) case QEMU_IFLA_CARRIER_DOWN_COUNT: case QEMU_IFLA_MIN_MTU: case QEMU_IFLA_MAX_MTU: + case QEMU_IFLA_GRO_MAX_SIZE: + case QEMU_IFLA_TSO_MAX_SIZE: + case QEMU_IFLA_TSO_MAX_SEGS: + case QEMU_IFLA_ALLMULTI: + case QEMU_IFLA_GSO_IPV4_MAX_SIZE: + case QEMU_IFLA_GRO_IPV4_MAX_SIZE: u32 =3D RTA_DATA(rtattr); *u32 =3D tswap32(*u32); break; @@ -1143,6 +1173,10 @@ static abi_long host_to_target_data_link_rtattr(stru= ct rtattr *rtattr) return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rt= a_len, NULL, host_to_target_data_vfinfo_nl= attr); + case QEMU_IFLA_PROP_LIST: + return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rt= a_len, + NULL, + host_to_target_data_prop_nlat= tr); default: qemu_log_mask(LOG_UNIMP, "Unknown host QEMU_IFLA type: %d\n", rtattr->rta_type); --=20 2.47.0