summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2017-07-14 20:08:18 +0800
committerJason Wang <jasowang@redhat.com>2017-07-17 20:13:56 +0800
commit189ae6bb5ce1f5a322f8691d00fe942ba43dd601 (patch)
tree75e7026c81e3a321a13c44112ef21a90b4d0bf3c /hw
parent5f997fd17b9be6a662fa7b5cc1305076cd6c8894 (diff)
downloadqemu-189ae6bb5ce1f5a322f8691d00fe942ba43dd601.zip
virtio-net: fix offload ctrl endian
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/virtio-net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 657d099c54..148071a396 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -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;
}