[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
- [Qemu-devel] [PATCH 00/12] add HOST_SUPPORTS_UNALIGNED_ACCESS, reduce slirp warnings, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-devel] [PATCH 01/12] slirp: remove QEMU_PACKED from structures with don't require it, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-devel] [PATCH 02/12] slirp: struct icmp/ethhdr ARE packed, Philippe Mathieu-Daudé, 2018/01/08
- Re: [Qemu-devel] [PATCH 02/12] slirp: struct icmp/ethhdr ARE packed,
Thomas Huth <=
- [Qemu-devel] [PATCH 03/12] slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero(), Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-devel] [PATCH 04/12] slirp: add in6_multicast() and use it instead of IN6_IS_ADDR_MULTICAST(), Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-devel] [PATCH 05/12] slirp: poison IN6_*_ADDR_*() macros to avoid them, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-devel] [PATCH 06/12] slirp: remove unused header, Philippe Mathieu-Daudé, 2018/01/08