[Spice-devel] [PATCH spice-common] quic: Fix endianness encoding

Christophe Fergeau cfergeau at redhat.com
Mon Jun 4 15:00:03 UTC 2018


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Mon, Jun 04, 2018 at 10:28:47AM +0100, Frediano Ziglio wrote:
> The image is going to network and network protocol is little endian
> so the numbers has to be little endian. Note that this is already done
> during decoding.
> Tested on a ppc64 machine.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  common/quic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/quic.c b/common/quic.c
> index 1ec6baa..e31f789 100644
> --- a/common/quic.c
> +++ b/common/quic.c
> @@ -393,7 +393,7 @@ static inline void write_io_word(Encoder *encoder)
>      if (encoder->io_now == encoder->io_end) {
>          more_io_words(encoder);
>      }
> -    *(encoder->io_now++) = encoder->io_word;
> +    *(encoder->io_now++) = GUINT32_TO_LE(encoder->io_word);
>  }
>  
>  static inline void encode(Encoder *encoder, unsigned int word, unsigned int len)
> -- 
> 2.17.1
> 
> _______________________________________________
> 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/20180604/f2948e4e/attachment-0001.sig>


More information about the Spice-devel mailing list