qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/7] tap: Fix virtio-net header buffer size


From: Michael Tokarev
Subject: Re: [PATCH v2 1/7] tap: Fix virtio-net header buffer size
Date: Tue, 10 Oct 2023 10:56:33 +0300
User-agent: Mozilla Thunderbird

10.10.2023 05:59, Akihiko Odaki wrote:
The largest possible virtio-net header is struct virtio_net_hdr_v1_hash.

Fixes: fbbdbddec0 ("tap: allow extended virtio header with hash info")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
  net/tap.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index c6639d9f20..ea46feeaa8 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -118,7 +118,7 @@ static ssize_t tap_receive_iov(NetClientState *nc, const 
struct iovec *iov,
      TAPState *s = DO_UPCAST(TAPState, nc, nc);
      const struct iovec *iovp = iov;
      struct iovec iov_copy[iovcnt + 1];
-    struct virtio_net_hdr_mrg_rxbuf hdr = { };
+    struct virtio_net_hdr_v1_hash hdr = { };

BTW, can we get rid of (implicit) memzero() here and in
similar places, initializing only the actually used fields?
Not that his particular structure is very large (and this
change makes it 8 bytes larger), but still..

Thanks,

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]