[Spice-devel] [PATCH spice-server] test-channel: Use correct endianness for ack message
Christophe Fergeau
cfergeau at redhat.com
Tue Jan 9 14:55:32 UTC 2018
For the series:
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
On Fri, Jan 05, 2018 at 12:12:00PM +0000, Frediano Ziglio wrote:
> Network fields should be encoded as little endian.
> This was discovered using an emulated MIPS machine.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180109/d355b019/attachment.sig>
More information about the Spice-devel
mailing list