qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Akihiko Odaki" <akihiko.odaki@daynix.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH] net/eth: Have eth_pad_short_frame() take void* arguments
Date: Mon,  8 Jan 2024 16:41:23 +0100	[thread overview]
Message-ID: <20240108154123.53680-1-philmd@linaro.org> (raw)

Any kind of buffer can hold an Ethernet frame, no just
arrays of unsigned chars.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 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_frags,
  * @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);
 
 #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 pkt_frags,
     return true;
 }
 
-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 >= ETH_ZLEN);
-- 
2.41.0



             reply	other threads:[~2024-01-08 15:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-08 15:41 Philippe Mathieu-Daudé [this message]
2024-01-09 12:10 ` [PATCH] net/eth: Have eth_pad_short_frame() take void* arguments Akihiko Odaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240108154123.53680-1-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=akihiko.odaki@daynix.com \
    --cc=bin.meng@windriver.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).