From nobody Thu Dec 26 11:52:56 2024 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=1732891252; cv=none; d=zohomail.com; s=zohoarc; b=k2nZQ1ob/JvRdL0rkBVQ+81WgM56C7yVfQomwYkUlV72iqdI6IfxIFXFGlMMtZlt0xcPU7rwcguUQCpXmOrhIi7Jl70s7lvrUhdRHorzPvQ2PRf5HgppgnXxaduFey9rdl+ivCXQ3as4PiWkXcqWK9Qz4pZ7XHvMkFfG1aSsVEU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732891252; 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=88Ny+mT4u8duvwkkrdnixAWCEdo+hS/RQqvjFfth0eU=; b=eg2qpGHS+fo9WwJaJeba3pYzveaIUagQsJScYJUstG36ixP98WgaSmFwLXPB+pBYj8bgtE7+nzd/wIci65zXcDyec7gseA0OFjHdIh7QebcPqrPbys8URgzZXpU8+BArjEwtOgAL/l+LpksSWdiDa9rcuZq2be7hWVrRizd5aOI= 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 1732891252480467.4124293606452; Fri, 29 Nov 2024 06:40:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH29N-0003JT-A6; Fri, 29 Nov 2024 09:39:17 -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 1tH29M-0003Ib-4t for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:16 -0500 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH29K-0005yJ-98 for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:15 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 90405A43E4A; Fri, 29 Nov 2024 14:37:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E064C4CED2; Fri, 29 Nov 2024 14:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732891145; bh=v6f7yFrp+w1dSGSDB/8wjHwhrFGDFL1edLYfFUIV1GU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WawiFro3NVkGj6ow66v4Wd5mDcGiszeN4wsxcwoPYU8ZAk20zYdYm8KPn59WI8zfE cZ2wGBAjWpvSEO8EK6hGjRkE30DqH1ucco8FDIZZE9KeIfgodXFzgovYTWv64tDivq N/IXpDwAfLbH/MoexhLbmlx07pmXCp5M8hmt4kjWfmaaT9tBvALUCRtUL9n/HMR0fr kWrkEsfdDa4CuTZaKx5hJ3YyuhBcT/d4qFx/uE5zBKjERB640G656bGFREbVq4cRRg 37boZWvOcGHRNV9j1lS7QBbGypm8AuLwsDAVrNIkdrga0Odnz6BcLXcFboJn1+0hRH GLRPWxeMOfxGg== From: deller@kernel.org To: Laurent Vivier , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 1/6] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr() Date: Fri, 29 Nov 2024 15:38:56 +0100 Message-ID: <20241129143901.11291-2-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241129143901.11291-1-deller@kernel.org> References: <20241129143901.11291-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:45d1:ec00::3; envelope-from=deller@kernel.org; helo=nyc.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: 1732891253375019100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Fixes this warning: Unknown host IFA type: 11 Signed-off-by: Helge Deller --- linux-user/fd-trans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index c04a97c73a..6191e3115b 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -1143,6 +1143,7 @@ static abi_long host_to_target_data_addr_rtattr(struc= t rtattr *rtattr) break; /* string */ case IFA_LABEL: + case IFA_PROTO: break; /* u32 */ case IFA_FLAGS: --=20 2.47.0 From nobody Thu Dec 26 11:52:56 2024 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=1732891231; cv=none; d=zohomail.com; s=zohoarc; b=Jclqp1N4P2MjUiKaGldDO3ogHc+UnP5LcgVQ7mEyQZVGCEwFLzuxAUiUdL9QDc9tNfvzUvQVYziNdxG5TAPo824npeq1c7qHlWpW190sxF+fY+j3hwqXCkq6SVM3OzowpU+Z5O64d+MYWY/eIrfyLnneHXasciOtBNiDzms9x58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732891231; 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=YBu4ugqKnF3Y1JWw4N9cxdh8w1VBkYrIzGVfMuUCzyM=; b=hOXi8BAFk/mRxVv1wyMjD+ZF6FWHvU2DGsWfEnS0Tg8z6I9kyB/9Qa6X2dnV0/rvYl5/mb88OjrVSAvp+BuDSNMHUrfsd7es9GIQ43DtXMShBzpx252K+ClBZ27Lhpbq6zo6hq1uBsFyqOK2D8ub6BMgAPYjMWilX9dE9FUGKSk= 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 1732891231105643.396719175221; Fri, 29 Nov 2024 06:40:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH29Q-0003Kk-3H; Fri, 29 Nov 2024 09:39:20 -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 1tH29M-0003Id-6y for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:16 -0500 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH29K-0005yw-Ri for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:15 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id D50B4A43F1D; Fri, 29 Nov 2024 14:37:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CF6BC4CECF; Fri, 29 Nov 2024 14:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732891147; bh=dFdJHS2fcUNzhLS8OVysMDJhrwIxQcz7Tz5F4UM1A7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pIoVefoRLtOjsGktSRMnw0TUTMYFRspdF8uKkw9scauf+1aFAliOs1iDNchCdq+sE s9eVT9EznlVG9YsUZ7x2IgO1JmGsMFYuz9O0qOwPm/tKgACsKDzmBKO4dzGrIHYAz1 0yVq7x1f62li9qoE35Pw4JcWRWZcA0HtnZIHBx1gIbGoaKvwrP+ILkgt9NvCEHYxFP ApxcgEnBOM4enB/5BF/WE8mnfpRjQSfd1jzx7HEV2tiBVmLtd+ey8zt4Nsaj/hD1YB Up6a7KZDA5zRGBEVPh1O8WIXpzVwB+8rS8kiel2mtSd+ZSQoA5bQmSL1pnJbksMFXT /ua4JCX44kuug== From: deller@kernel.org To: Laurent Vivier , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 2/6] linux-user: Use unique error messages for cmsg parsing Date: Fri, 29 Nov 2024 15:38:57 +0100 Message-ID: <20241129143901.11291-3-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241129143901.11291-1-deller@kernel.org> References: <20241129143901.11291-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:45d1:ec00::3; envelope-from=deller@kernel.org; helo=nyc.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: 1732891231378019100 Content-Type: text/plain; charset="utf-8" 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 --- 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 1ce4c79784..494323efba 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1825,7 +1825,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); } @@ -2047,7 +2047,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 Thu Dec 26 11:52:56 2024 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=1732891232; cv=none; d=zohomail.com; s=zohoarc; b=f1MaC1cvRRD8lyvb6fvNE6aa0b1jK/jflJ5ESQrOXJjpmYZR3sdDiOhfDDupzUjAR4GWgjJVd9udxN5MUaZB+X0JL6Cu4YfiXM9VfZrS0yUNMdiJ01vDQ14pP1ZrVwJ1YyTsBXJPRjTbSaaPYKB9o1goCo1Pkglfg4kt8zHgoyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732891232; 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=BtoKfb3dXk+S07guxrX+TMTm5iBlalgagWyvX0BbyAU=; b=d0MsYkXVt2cZRe0Yn7BJOLbORM9Gzum09iYB3QAITiWqMrbALFa3aNcUJnRK0urAkWpR6Mlbvb36KRJhuOn32ML2QUK1XXucLuDusXkGmWh5M0xHEe2h4mnS1zF135RUS+h2Cx0UjXoIFWYRWmsHPYhPQUMHieK9w7pCC5RePNI= 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 1732891232781720.9505812230742; Fri, 29 Nov 2024 06:40:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH29Q-0003Km-NL; Fri, 29 Nov 2024 09:39:20 -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 1tH29N-0003JK-1d for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:17 -0500 Received: from nyc.source.kernel.org ([147.75.193.91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH29L-0005z6-Nx for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:16 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 26780A43F21; Fri, 29 Nov 2024 14:37:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A25FFC4CED2; Fri, 29 Nov 2024 14:39:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732891148; bh=Z3ILH7yeOybgi1/CJ1rwkFp19U43yvxFnde7k2lHHz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YZHbfxSPXvPUMX4Z22/xErwwFsIIZPWdny72PArWUQPCvyRwxBVm6sgFS34GB46i3 fgoQ310jTspZi2huDZoJ4/Y76KJ/DNcYuYRkhbXH573sCR2XgG8/2qZDkDbfFWTPEP XQmwZWLIbtZsNQ01nXs8cr/gE7npSaetBRi51NmJpGXt5/jN2MeUpeD4Wl3eFQ0vTY bEbaxT46Buir6vV8Z4KXJ/G+ExJUVc/IaiGsie+mK40ws1DKU2PROJ5SkHzMeGZEHN HciMztBdZlvbiT2kxt9dy9Puhm+vtqxLCmnXGrEhRDnVu8LMZiq3rRYqDBqVKUKpCc yBDFf4LGbaqNA== From: deller@kernel.org To: Laurent Vivier , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 3/6] linux-user: netlink: Add IP_PKTINFO cmsg parsing Date: Fri, 29 Nov 2024 15:38:58 +0100 Message-ID: <20241129143901.11291-4-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241129143901.11291-1-deller@kernel.org> References: <20241129143901.11291-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=147.75.193.91; envelope-from=deller@kernel.org; helo=nyc.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1732891233307019100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Fixes those warnings: Unsupported host ancillary data: 0/8 Signed-off-by: Helge Deller --- linux-user/syscall.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 494323efba..bbe2560927 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1996,6 +1996,18 @@ 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 in_pktinfo *target_pkti =3D target_data; + + __put_user(pkti->ipi_ifindex, &target_pkti->ipi_ifindex); + host_to_target_sockaddr((unsigned long) &target_pkti->ipi_= spec_dst, + (void *) &pkti->ipi_spec_dst, sizeof(pkti->ipi_spec_ds= t)); + host_to_target_sockaddr((unsigned long) &target_pkti->ipi_= addr, + (void *) &pkti->ipi_addr, sizeof(pkti->ipi_addr)); + break; + } default: goto unimplemented; } --=20 2.47.0 From nobody Thu Dec 26 11:52:56 2024 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=1732891243; cv=none; d=zohomail.com; s=zohoarc; b=RAxb5E1ol6WoI6+4K5hR213zYJQnQxbyuN9PBk7WPJENUQfjeYFRJe+N+qedp+aHmC8LABeYcRrjqo5ORkHbUOPOHBlvbFz9p+mfMcMWQ2jrzpixgRI5GMj+adcTc3Q2vPFq9Bt+pPOb1ZACMeoHPB4nx1Vyu/eBbTydoD2jcpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732891243; 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=8AdP5Zv+2RdLRQGwHW6ewJo6MtWnMvXaYtodV5cidck=; b=beGbys/2LAn7qwxswIMybG5SQzZsUyW3Yx1qwFfFdFY8LynWr5T/UWyg6apbn75h0knvYNIt3GhbjxMuERYFTTss8dhM2mPulKAevTGtGxYQWKvTBj+hYSAaD1ZS7MH5Jqn9aJyYlA3IXD2DWmgDBMvjjjE/oCaZGeJHoYiXdhY= 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 17328912434231009.4566716982729; Fri, 29 Nov 2024 06:40:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH29R-0003Lb-Um; Fri, 29 Nov 2024 09:39:21 -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 1tH29P-0003Ka-EF for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:19 -0500 Received: from nyc.source.kernel.org ([147.75.193.91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH29O-0005zX-25 for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:19 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 743ECA43F22; Fri, 29 Nov 2024 14:37:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7E4FC4CECF; Fri, 29 Nov 2024 14:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732891149; bh=7sDAkRnZ08OkWc2JgsOLVf4mCXc++peN2aQFHOAIuw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jidt8OSla1P65EUfuP36JDekth5omNY9/fCGgLtWiAnP4ohyWbq/WW5qzQk9VqcJs 55+Pwa5/oHknTHSsf8BtId1MHVfObnaypdomcDTY3oMsFL62PsZcwSKCh/c3kQwNED 6QHWC8dG68Qo4c4uhRFTAIhZE68W7Zg/3vGt4mg20JmMwAxse3/8/7cAlWYFrR02/b j2PHpLDj5QAeLZ9sMqqORfS1JL/Zqe2WXmK9YssdCXFLpVFPTpjG46hdCZfhGCI+XU QlElqKeWEo/9go6B/lGxTSA4DARWSC8c07s8idyIQKgicClgU5ryqNSUAj3TnotAUQ KvnpzA63OqqqA== From: deller@kernel.org To: Laurent Vivier , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 4/6] linux-user: netlink: Add emulation of IP_MULTICAST_IF Date: Fri, 29 Nov 2024 15:38:59 +0100 Message-ID: <20241129143901.11291-5-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241129143901.11291-1-deller@kernel.org> References: <20241129143901.11291-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=147.75.193.91; envelope-from=deller@kernel.org; helo=nyc.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1732891245364019100 Content-Type: text/plain; charset="utf-8" From: Helge Deller Share code with IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP. Signed-off-by: Helge Deller --- linux-user/syscall.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bbe2560927..4360543e20 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,7 +2156,9 @@ 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 sizeof(struct target_ip_mreq)) { + ip_mreq.imr_address.s_addr =3D target_smreqn->imr_address.= s_addr; + } 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); --=20 2.47.0 From nobody Thu Dec 26 11:52:56 2024 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=1732891239; cv=none; d=zohomail.com; s=zohoarc; b=V8dRVvnO441ZaLCIRQMREqUNpOzmkwG4dRvbZmdrzINs07EPsfVtxyXjZYHoSIBiuvYkx2ZKiyQC+JJEzzhi21H3RqsZG6D4tVZ0pl2Z0MTh0ezyBQrLCjZj8LDiXbGbDrmIxIMd8qH8Q6yHOLEeol2StZy0H8yo8yePR/goBw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732891239; 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=u3vT2NGqWF2ZNSLPFiGwb6GgN/ula2L8yU0p6681lmo=; b=LEx+rRUSAab/IWX7OO9pHPSCVyVvldrpAMNlcsU/imlWQ07S8rNkosF5OGxLpdOUtCwTQnBnPrVaLVyQ4Jl3nU/z4jraj9Eyh2qSpIFnOi91bwJdkakpE6xcQ6K7HjS1nS86DWuGTzJeIAXECMisWuTbssfD5L41Zr0n2IkH7fI= 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 1732891239907610.6692024895883; Fri, 29 Nov 2024 06:40:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH29Q-0003Kn-NX; Fri, 29 Nov 2024 09:39:20 -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 1tH29N-0003Jg-Ke for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:17 -0500 Received: from nyc.source.kernel.org ([147.75.193.91]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH29M-00060Y-1L for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:17 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id B7B07A43F24; Fri, 29 Nov 2024 14:37:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F91BC4CED2; Fri, 29 Nov 2024 14:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732891151; bh=MgRTP22t4SKUiYqLZ8THhSKfE5EfZJjrqXomHG893eg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JKgjA/k5itQ13Wri+f7RcHaRMVosbHW1wQaFgcugcZ/m6x4nlVvactFaLm5r0/8o1 iTEDq5K8DM3Z44+J/Bx+J99HKvvgEdDCPPTsr3W5DAXMqhh/1uhIOzV3sa7v2r/3zp P/7BAKKUj3Zu5KHlzzpvLY3B9vYXt6kXLT4c7h+v6qlZLcE5w6BnDeoSCem4gpABEu FPfuAef/ThqGU/u49Y6nRWxShyKsB8ZxTqxCLH77gSAUiqslj3ZhzZ2HAg7ZK900nB UPfInVvFx6i+7xL3Ioz87l8o8KMUBjBzC25GhWi3gNLvKO9HdgdibEca6qOYdGEgt3 qlPKFjMU2CCAQ== From: deller@kernel.org To: Laurent Vivier , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 5/6] linux-user: netlink: add netlink neighbour emulation Date: Fri, 29 Nov 2024 15:39:00 +0100 Message-ID: <20241129143901.11291-6-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241129143901.11291-1-deller@kernel.org> References: <20241129143901.11291-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=147.75.193.91; envelope-from=deller@kernel.org; helo=nyc.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1732891241520019100 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 --- 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 6191e3115b..e861572a35 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_IFLA_BR_UNSPEC, QEMU_IFLA_BR_FORWARD_DELAY, @@ -1210,6 +1214,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) { @@ -1231,12 +1264,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) { @@ -1263,6 +1304,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: @@ -1410,6 +1462,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; @@ -1448,6 +1529,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) { @@ -1460,6 +1548,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: @@ -1486,6 +1575,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 Thu Dec 26 11:52:56 2024 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=1732891217; cv=none; d=zohomail.com; s=zohoarc; b=PG6BdGPiQD+IoditIYKA3An7ye1POdQAVoyRFk2GGknJScyJiaXGMpAkw67vkNVGWpux81ph+kj28mT9vy/D01amt38/AbzJLsDcg590LTrvYGeRENOfvwtWlcjf2h1od6kL+hy4WOvPK0E0A99PnIBzJkvQEI2aw9H/GKHXNXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732891217; 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=ofeJK0TLrkb7X3f4hISlHw00Bhw851WCJR8vkbT5TLM=; b=VpAgHEzzKwUiO/EnE0++MjH1uGkYZz4+6Fo90MdL03fBg82Ub/ftYwPVt3LmWIlsQTqNJIpY9po2cppDLWHrCyXgTwhFCu+kTCC0vYN8IcuZ0z7YIPhaQkBdd3TSi/w5UAQAlZ9VlmSIcUzI/dA0NjuKmyINqqU+RsXseXcE68w= 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 1732891217786563.3131455913161; Fri, 29 Nov 2024 06:40:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH29O-0003K6-2y; Fri, 29 Nov 2024 09:39:18 -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 1tH29M-0003If-7I for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:16 -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 1tH29K-00060K-9C for qemu-devel@nongnu.org; Fri, 29 Nov 2024 09:39:15 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 723B05C4DA6; Fri, 29 Nov 2024 14:38:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 850D8C4CECF; Fri, 29 Nov 2024 14:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732891152; bh=JIAgHf9SG8xDQAlX/nzKIzJCdyhLa+jR2v0v7FyXf+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B8MSV5Aezwd2yPP6OrT5RHrdDaJbHIyZ1ZQkRH8m+MsSjAYZwrkPhhuYrgQlPHZ+8 jct5EQ5WnRtU/SQRgPh+hvOMEhO0TUiV8T+OCBHdp5a0xvnEG2Gsy6/DjYazJgDW1o zsMb8MfC3yrgFI7PLOgnMhjtaZltIH+1DQ5STFXiJNKudqj4Qmf5eOWDw8HXe4VUn+ yc95nAMuBoysmwLqsnc4kxcp8DpM2HWeQYaybg+7RrqOWqUkiv5lv0lCKeJuy+ZoFg 38vmOaPa5UuIlblBt1fbHdXffWKAMs1sZ0SYSHw4cRiikrLJEBXTIvhfTdPyoSDYLb q77/muL80p5Hw== From: deller@kernel.org To: Laurent Vivier , qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 6/6] linux-user: netlink: Add missing QEMU_IFLA entries Date: Fri, 29 Nov 2024 15:39:01 +0100 Message-ID: <20241129143901.11291-7-deller@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241129143901.11291-1-deller@kernel.org> References: <20241129143901.11291-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: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1732891219349019100 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 --- 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 e861572a35..1383ed591c 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -145,6 +145,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 @@ -986,6 +994,22 @@ static abi_long host_to_target_data_vfinfo_nlattr(stru= ct 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; @@ -994,7 +1018,7 @@ static abi_long host_to_target_data_link_rtattr(struct= 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: @@ -1032,6 +1056,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; @@ -1127,6 +1157,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