]> Git Repo - qemu.git/commitdiff
net: don't set native endianness
authorMichael S. Tsirkin <[email protected]>
Wed, 14 Oct 2015 09:11:27 +0000 (12:11 +0300)
committerMichael S. Tsirkin <[email protected]>
Wed, 21 Oct 2015 06:24:44 +0000 (09:24 +0300)
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 <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: [email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
net/net.c

index 39af8930b427bbb427d4a9ce54ffe60dd91d445c..3c68f3faa8a62c90f5c18fe65a2ae6449cfe7b70 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -524,20 +524,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)
This page took 0.027678 seconds and 4 git commands to generate.