On Thu, 12 Feb 2026 12:39:31 +0100
Laurent Vivier
Replace all open-coded sizeof(struct virtio_net_hdr_mrg_rxbuf) with a VNET_HLEN macro.
Signed-off-by: Laurent Vivier
--- tcp_vu.c | 21 +++++++-------------- udp_vu.c | 12 ++++-------- virtio.h | 2 ++ vu_common.c | 13 +++++-------- vu_common.h | 2 +- 5 files changed, 19 insertions(+), 31 deletions(-) diff --git a/tcp_vu.c b/tcp_vu.c index b9e9b55ed3d3..f7bda4943e43 100644 --- a/tcp_vu.c +++ b/tcp_vu.c @@ -49,8 +49,7 @@ static size_t tcp_vu_hdrlen(bool v6) { size_t hdrlen;
- hdrlen = sizeof(struct virtio_net_hdr_mrg_rxbuf) + - sizeof(struct ethhdr) + sizeof(struct tcphdr); + hdrlen = VNET_HLEN + sizeof(struct ethhdr) + sizeof(struct tcphdr);
My eyes thank you dearly. -- Stefano