qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 71/79] virtio-net: fix offload ctrl endian


From: Michael Roth
Subject: [Qemu-devel] [PATCH 71/79] virtio-net: fix offload ctrl endian
Date: Mon, 28 Aug 2017 19:14:46 -0500

From: Jason Wang <address@hidden>

Spec said offloads should be le64, so use virtio_ldq_p() to guarantee
valid endian.

Fixes: 644c98587d4c ("virtio-net: dynamic network offloads configuration")
Cc: address@hidden
Cc: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
(cherry picked from commit 189ae6bb5ce1f5a322f8691d00fe942ba43dd601)
Signed-off-by: Michael Roth <address@hidden>
---
 hw/net/virtio-net.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 98bd683..7695f75 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -723,6 +723,8 @@ static int virtio_net_handle_offloads(VirtIONet *n, uint8_t 
cmd,
     if (cmd == VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET) {
         uint64_t supported_offloads;
 
+        offloads = virtio_ldq_p(vdev, &offloads);
+
         if (!n->has_vnet_hdr) {
             return VIRTIO_NET_ERR;
         }
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]