]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-net: unbreak any layout
authorJason Wang <jasowang@redhat.com>
Fri, 17 Jul 2015 07:19:18 +0000 (15:19 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 30 Jul 2015 03:10:36 +0000 (22:10 -0500)
commit46addaa0b52539790ab4254d37e3367a5b77853f
tree438683b3e4941a024e84be12930456a96eb05ae9
parent5a4568717c5515c181e949aceee972b78cd642d1
virtio-net: unbreak any layout

Commit 032a74a1c0fcdd5fd1c69e56126b4c857ee36611
("virtio-net: byteswap virtio-net header") breaks any layout by
requiring out_sg[0].iov_len >= n->guest_hdr_len. Fixing this by
copying header to temporary buffer if swap is needed, and then use
this buffer as part of out_sg.

Fixes 032a74a1c0fcdd5fd1c69e56126b4c857ee36611
("virtio-net: byteswap virtio-net header")
Cc: qemu-stable@nongnu.org
Cc: clg@fr.ibm.com
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit feb93f361739071778ca2d23df3876db399548f7)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/net/virtio-net.c
include/hw/virtio/virtio-access.h