qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL] slirp: Fix issues with -mms-bitfields


From: Blue Swirl
Subject: Re: [Qemu-devel] [PULL] slirp: Fix issues with -mms-bitfields
Date: Sun, 21 Aug 2011 19:49:06 +0000

Thanks, pulled.

On Mon, Aug 15, 2011 at 6:39 AM, Jan Kiszka <address@hidden> wrote:
> The following changes since commit 3b6ffe50300f13240e1b46420ad05da1116df410:
>
>  hw/scsi-bus.c: Fix use of uninitialised variable (2011-08-14 19:34:25 +0000)
>
> are available in the git repository at:
>  git://git.kiszka.org/qemu.git queues/slirp
>
> Jan Kiszka (1):
>      slirp: Fix bit field types in IP header structs
>
>  slirp/ip.h  |    8 ++++----
>  slirp/tcp.h |    4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> ---
>
> slirp: Fix bit field types in IP header structs
>
> -mms-bitfields prevents that the bitfields in current IP header structs
> are packed into a single byte as it is required. Fix this by using
> uint8_t as backing type.
>
> Signed-off-by: Jan Kiszka <address@hidden>
> ---
>  slirp/ip.h  |    8 ++++----
>  slirp/tcp.h |    4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/slirp/ip.h b/slirp/ip.h
> index 48ea38e..72dbe9a 100644
> --- a/slirp/ip.h
> +++ b/slirp/ip.h
> @@ -74,10 +74,10 @@ typedef uint32_t n_long;                 /* long as 
> received from the net */
>  */
>  struct ip {
>  #ifdef HOST_WORDS_BIGENDIAN
> -       u_int ip_v:4,                   /* version */
> +       uint8_t ip_v:4,                 /* version */
>                ip_hl:4;                /* header length */
>  #else
> -       u_int ip_hl:4,          /* header length */
> +       uint8_t ip_hl:4,                /* header length */
>                ip_v:4;                 /* version */
>  #endif
>        uint8_t         ip_tos;                 /* type of service */
> @@ -140,10 +140,10 @@ struct    ip_timestamp {
>        uint8_t ipt_len;                /* size of structure (variable) */
>        uint8_t ipt_ptr;                /* index of current entry */
>  #ifdef HOST_WORDS_BIGENDIAN
> -       u_int   ipt_oflw:4,             /* overflow counter */
> +       uint8_t ipt_oflw:4,             /* overflow counter */
>                ipt_flg:4;              /* flags, see below */
>  #else
> -       u_int   ipt_flg:4,              /* flags, see below */
> +       uint8_t ipt_flg:4,              /* flags, see below */
>                ipt_oflw:4;             /* overflow counter */
>  #endif
>        union ipt_timestamp {
> diff --git a/slirp/tcp.h b/slirp/tcp.h
> index 9d06836..b3817cb 100644
> --- a/slirp/tcp.h
> +++ b/slirp/tcp.h
> @@ -51,10 +51,10 @@ struct tcphdr {
>        tcp_seq th_seq;                 /* sequence number */
>        tcp_seq th_ack;                 /* acknowledgement number */
>  #ifdef HOST_WORDS_BIGENDIAN
> -       u_int   th_off:4,               /* data offset */
> +       uint8_t th_off:4,               /* data offset */
>                th_x2:4;                /* (unused) */
>  #else
> -       u_int   th_x2:4,                /* (unused) */
> +       uint8_t th_x2:4,                /* (unused) */
>                th_off:4;               /* data offset */
>  #endif
>        uint8_t th_flags;
>
>
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]