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>
This commit is contained in:
parent
5f997fd17b
commit
189ae6bb5c
@ -758,6 +758,8 @@ static int virtio_net_handle_offloads(VirtIONet *n, uint8_t cmd,
|
|||||||
if (cmd == VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET) {
|
if (cmd == VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET) {
|
||||||
uint64_t supported_offloads;
|
uint64_t supported_offloads;
|
||||||
|
|
||||||
|
offloads = virtio_ldq_p(vdev, &offloads);
|
||||||
|
|
||||||
if (!n->has_vnet_hdr) {
|
if (!n->has_vnet_hdr) {
|
||||||
return VIRTIO_NET_ERR;
|
return VIRTIO_NET_ERR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user