summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2015-10-14 12:11:27 +0300
committerMichael Roth <mdroth@linux.vnet.ibm.com>2015-10-31 12:35:16 -0500
commit9137bd24c8165192917471dca67b778c301fcd54 (patch)
treee6ef69277359ad9c883b0761bb733b36de846550 /net
parent08231cbb7660876903019ef1b59ef332deea2a83 (diff)
downloadqemu-9137bd24c8165192917471dca67b778c301fcd54.tar.gz
net: don't set native endianness
commit 5be7d9f1b1452613b95c6ba70b8d7ad3d0797991 vhost-net: tell tap backend about the vnet endianness makes vhost net always try to set LE - even if that matches the native endian-ness. This makes it fail on older kernels on x86 without TUNSETVNETLE support. To fix, make qemu_set_vnet_le/qemu_set_vnet_be skip the ioctl if it matches the host endian-ness. Reported-by: Marcel Apfelbaum <marcel@redhat.com> Cc: Greg Kurz <gkurz@linux.vnet.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> (cherry picked from commit 052bd52fa978d3f04bc476137ad6e1b9a697f9bd) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'net')
-rw-r--r--net/net.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index 28a5597b8d..8e96011e6b 100644
--- a/net/net.c
+++ b/net/net.c
@@ -517,20 +517,28 @@ void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
int qemu_set_vnet_le(NetClientState *nc, bool is_le)
{
+#ifdef HOST_WORDS_BIGENDIAN
if (!nc || !nc->info->set_vnet_le) {
return -ENOSYS;
}
return nc->info->set_vnet_le(nc, is_le);
+#else
+ return 0;
+#endif
}
int qemu_set_vnet_be(NetClientState *nc, bool is_be)
{
+#ifdef HOST_WORDS_BIGENDIAN
+ return 0;
+#else
if (!nc || !nc->info->set_vnet_be) {
return -ENOSYS;
}
return nc->info->set_vnet_be(nc, is_be);
+#endif
}
int qemu_can_send_packet(NetClientState *sender)