mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
fa7cad4aee
commit
72796d62eb
@@ -239,7 +239,7 @@ impl RxVirtio {
|
|||||||
.memory()
|
.memory()
|
||||||
.checked_offset(
|
.checked_offset(
|
||||||
desc.addr()
|
desc.addr()
|
||||||
.translate_gva(access_platform, desc.len() as usize)
|
.translate_gva(access_platform, vnet_hdr_len())
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
NetQueuePairError::GuestMemory(
|
NetQueuePairError::GuestMemory(
|
||||||
vm_memory::GuestMemoryError::IOError(e),
|
vm_memory::GuestMemoryError::IOError(e),
|
||||||
|
|||||||
Reference in New Issue
Block a user