qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/12] slirp: struct icmp/ethhdr ARE packed


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH 02/12] slirp: struct icmp/ethhdr ARE packed
Date: Mon, 8 Jan 2018 18:43:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 08.01.2018 18:28, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  slirp/ip6_icmp.h | 6 +++---
>  slirp/ip_icmp.h  | 2 +-
>  slirp/slirp.h    | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/slirp/ip6_icmp.h b/slirp/ip6_icmp.h
> index b3378b17b5..a4ccc69974 100644
> --- a/slirp/ip6_icmp.h
> +++ b/slirp/ip6_icmp.h
> @@ -17,20 +17,20 @@
>  struct icmp6_echo { /* Echo Messages */
>      uint16_t id;
>      uint16_t seq_num;
> -};
> +} QEMU_PACKED;
>  
>  union icmp6_error_body {
>      uint32_t unused;
>      uint32_t pointer;
>      uint32_t mtu;
> -};
> +} QEMU_PACKED;
>  
>  /*
>   * NDP Messages
>   */
>  struct ndp_rs {     /* Router Solicitation Message */
>      uint32_t reserved;
> -};
> +} QEMU_PACKED;
...
> diff --git a/slirp/slirp.h b/slirp/slirp.h
> index 9f29b52610..9a7287e7cc 100644
> --- a/slirp/slirp.h
> +++ b/slirp/slirp.h
> @@ -103,7 +103,7 @@ struct ethhdr {
>      unsigned char  h_dest[ETH_ALEN];   /* destination eth addr */
>      unsigned char  h_source[ETH_ALEN]; /* source ether addr    */
>      unsigned short h_proto;            /* packet type ID field */
> -};
> +} QEMU_PACKED;
>  
>  struct slirp_arphdr {
>      unsigned short ar_hrd;      /* format of hardware address */
> 

The above structs all look naturally aligned to me - so why do you need
the QEMU_PACKED here?

 Thomas



reply via email to

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