From nobody Tue Nov 26 20:32:03 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704728535; cv=none; d=zohomail.com; s=zohoarc; b=NvFwmucQTCBUYWJEDf7s4EoEWFBjBqty/OVDnprSVq5nsb/rO7RJn16mXJGQ0nglP3jxQlBT1dKimMqgGsHOGmPlwbsBMbyM51cCBbIJ34Lpy27Z8rJB0nK63pMs5rkDccYs4wvzmp8mWstc8now0VtdT4F/gIMmEZ/ZSovY/kU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704728535; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OgFybPQwNuMp3NAFbCe3JoR0imHvNQVIavgG+VFaK5A=; b=nlKlH0zCn/su2hqrBQAjfUDFZFPth3iC/YtN/TRR4ZOZ0aBhi2PXnhKOAeJf19MhERrHjbehcEmva0a3wi7TMkVEOEUHATNqq5OnFyG466HAXj9F8BaGZ2+72myu6sFGDHN253jPvcQVwDNtCh09R0lEDF2JQkCzremBSaDraeU= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704728535121429.8560054693547; Mon, 8 Jan 2024 07:42:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMrkt-0000aS-2t; Mon, 08 Jan 2024 10:41: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 1rMrko-0000YF-F6 for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:41:31 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMrkm-0001SD-G2 for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:41:30 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33765009941so1622782f8f.3 for ; Mon, 08 Jan 2024 07:41:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.62]) by smtp.gmail.com with ESMTPSA id f12-20020adfc98c000000b003366aad3564sm8100493wrh.30.2024.01.08.07.41.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 08 Jan 2024 07:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704728486; x=1705333286; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OgFybPQwNuMp3NAFbCe3JoR0imHvNQVIavgG+VFaK5A=; b=j8InsCNr2tKOzvyLiaSEr24bZXrMCLN/8vnu7ggvl06qOUwNIMe3WV//oJEJDZA2ka Zv7tLZHC3xanz63b9UfDzsX0eOukoAvPrji7O0CsAmlMX8bkPSRC0XS1Njhqq+gzpv3i IMqaKiqAadiaK/6LdbZZ1OHCFr+TGSG6jP7UPVnl3KCYvv8mW4Zq6nWNws5VlCW+MHGx FM+ZhgHs5vlb+zKN+rbTG+xUShfstepbU4WMGC1CR5FfDolGiA37zFIYzXX/XWHh3CMH 8YQheqm+ifGnyPulbweRK+8xuUkCTEtuTysrVDRiwLUjwvnHt9snZRMieS2ArogxVhOz DeLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704728486; x=1705333286; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OgFybPQwNuMp3NAFbCe3JoR0imHvNQVIavgG+VFaK5A=; b=upi7EctyA7SU5BRtHpR8ofRtS+6O1HiJtWlYiKKQjF7mCAlVOAfzodKCtDlbOauE1x VVWHstavVYpDtb8awwE/Ui9XiFA4kPGavIe4hUVodl14+jtOuFgoB6PZgACDxqlbSR5c ndboD2FX1V+l/zGynnDapM278lPcXjIn15dsOrJ+gpzIOwinnjIDL8n3r5iw359Fpq9Y EvvfD97SDxsxaD5318U5z0NV6jnNxlFGOYTAvGEEfsgboJ7/amsixglHS7GQNLn023op qQBUKZArD10MPdEfZRlYI6mseNZ/hGmPMde0oOGE91yqRPGX6ABQ9qUyF2zK0NgzbjZW 6JUg== X-Gm-Message-State: AOJu0Ywou+6AMVWT6ioKV9ugQWwgmkvprB3b+B0Pw+udrulHroIlfou2 Nb7OpFRQWtz+VrWb+3iXduvpnFIryIAYkpi/TenhLXPHz9M= X-Google-Smtp-Source: AGHT+IGsTHacUUL78K+z3TJue6YRbJrCUTd72LKP7NY39Q5sAGck/L7q3e3fZVxwRGJehAJtaxpOfg== X-Received: by 2002:a05:6000:14e:b0:337:2940:ab7b with SMTP id r14-20020a056000014e00b003372940ab7bmr2615978wrx.1.1704728486010; Mon, 08 Jan 2024 07:41:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Dmitry Fleytman , Bin Meng , Jason Wang , Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] net/eth: Have eth_pad_short_frame() take void* arguments Date: Mon, 8 Jan 2024 16:41:23 +0100 Message-ID: <20240108154123.53680-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 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=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 @linaro.org) X-ZM-MESSAGEID: 1704728536676100003 Any kind of buffer can hold an Ethernet frame, no just arrays of unsigned chars. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki --- include/net/eth.h | 2 +- net/eth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/eth.h b/include/net/eth.h index 3b80b6e07f..d73737f07d 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -434,7 +434,7 @@ eth_parse_ipv6_hdr(const struct iovec *pkt, int pkt_fra= gs, * @pkt_size: size of the original Ethernet frame * @return true if the frame is padded, otherwise false */ -bool eth_pad_short_frame(uint8_t *padded_pkt, size_t *padded_buflen, +bool eth_pad_short_frame(void *padded_pkt, size_t *padded_buflen, const void *pkt, size_t pkt_size); =20 #endif diff --git a/net/eth.c b/net/eth.c index 3f680cc033..25c6eb9b20 100644 --- a/net/eth.c +++ b/net/eth.c @@ -520,7 +520,7 @@ bool eth_parse_ipv6_hdr(const struct iovec *pkt, int pk= t_frags, return true; } =20 -bool eth_pad_short_frame(uint8_t *padded_pkt, size_t *padded_buflen, +bool eth_pad_short_frame(void *padded_pkt, size_t *padded_buflen, const void *pkt, size_t pkt_size) { assert(padded_buflen && *padded_buflen >=3D ETH_ZLEN); --=20 2.41.0