]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
virtio-net: fix offload ctrl endian
authorJason Wang <jasowang@redhat.com>
Fri, 14 Jul 2017 12:08:18 +0000 (20:08 +0800)
committerJason Wang <jasowang@redhat.com>
Mon, 17 Jul 2017 12:13:56 +0000 (20:13 +0800)
Spec said offloads should be le64, so use virtio_ldq_p() to guarantee
valid endian.

Fixes: 644c98587d4c ("virtio-net: dynamic network offloads configuration")
Cc: qemu-stable@nongnu.org
Cc: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/virtio-net.c

index 657d099c5440b0835f8355932394f1caeffd6672..148071a3969986aec119c040d6924ea8e7a145d7 100644 (file)
@@ -758,6 +758,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;
         }