[PATCH spice-server] test-channel: Use correct endianness for ack message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Network fields should be encoded as little endian.
This was discovered using an emulated MIPS machine.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/tests/test-channel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/tests/test-channel.c b/server/tests/test-channel.c
index fb3db389..455711eb 100644
--- a/server/tests/test-channel.c
+++ b/server/tests/test-channel.c
@@ -189,9 +189,9 @@ static void send_ack_sync(int socket, uint32_t generation)
         uint32_t generation;
     } msg;
     SPICE_VERIFY(sizeof(msg) == 12);
-    msg.type = SPICE_MSGC_ACK_SYNC;
-    msg.len = sizeof(generation);
-    msg.generation = generation;
+    msg.type = GUINT16_TO_LE(SPICE_MSGC_ACK_SYNC);
+    msg.len = GUINT32_TO_LE(sizeof(generation));
+    msg.generation = GUINT32_TO_LE(generation);
 
     g_assert_cmpint(write(socket, &msg.type, 10), ==, 10);
 }
-- 
2.14.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]