diff options
author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2024-04-28 16:00:49 +0900 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2024-06-04 15:14:26 +0800 |
commit | 77db537995be8bcab215a99bc9c1b51066b56557 (patch) | |
tree | 1ce0bdff16f20a13bd75a98b558855d66b90270c /net | |
parent | 336a058b26bb5229070f1e10ba0f63ae35420adc (diff) |
tap: Shrink zeroed virtio-net header
tap prepends a zeroed virtio-net header when writing a packet to a
tap with virtio-net header enabled but not in use. This only happens
when s->host_vnet_hdr_len == sizeof(struct virtio_net_hdr).
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/tap.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -119,7 +119,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; g_autofree struct iovec *iov_copy = NULL; - struct virtio_net_hdr_mrg_rxbuf hdr = { }; + struct virtio_net_hdr hdr = { }; if (s->host_vnet_hdr_len && !s->using_vnet_hdr) { iov_copy = g_new(struct iovec, iovcnt + 1); |