Writing the checksum in the packet needs room for 2 bytes, not 1 byte.
Fixes: ca7036b4af3a ("vhost: fix offload flags in Rx path")
Cc: [email protected]
Signed-off-by: Morten Brørup <[email protected]>
---
lib/vhost/virtio_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 8bdddedccf..eb099d206b 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -2848,7 +2848,7 @@ vhost_dequeue_offload(struct virtio_net *dev, struct
virtio_net_hdr *hdr,
if (likely(csum != 0xffff))
csum = ~csum;
off = hdr->csum_offset + hdr->csum_start;
- if (rte_pktmbuf_data_len(m) >= off + 1)
+ if (rte_pktmbuf_data_len(m) >= off + sizeof(uint16_t))
*rte_pktmbuf_mtod_offset(m, uint16_t *, off) =
csum;
}
}
--
2.43.0