net_util: queue_pair: Use vnet_hdr_len when locating num_buffers

num_buffers sits at offset 10 of the virtio net header, so only
vnet_hdr_len() bytes need to translate contiguously to compute
its host address. Shrink the translate_gva length from desc.len()
to vnet_hdr_len() so the request matches what is actually read.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-07-01 23:02:59 +02:00
committed by Rob Bradford
parent fa7cad4aee
commit 72796d62eb

View File

@@ -239,7 +239,7 @@ impl RxVirtio {
.memory()
.checked_offset(
desc.addr()
.translate_gva(access_platform, desc.len() as usize)
.translate_gva(access_platform, vnet_hdr_len())
.map_err(|e| {
NetQueuePairError::GuestMemory(
vm_memory::GuestMemoryError::IOError(e),