slirp: Avoid marking naturally packed structs as QEMU_PACKED
commitc74e3ae9c83750705abaa583b28741d349364561
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 22 Jan 2019 18:18:21 +0000 (22 18:18 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 7 Feb 2019 13:49:08 +0000 (7 15:49 +0200)
tree2c344866635145a63a12c4891b84f9ed16c15388
parent59fa06ac74c1736dd1270fadde6a0077877bea04
slirp: Avoid marking naturally packed structs as QEMU_PACKED

Various ipv6 structs in the slirp headers are marked QEMU_PACKED,
but they are actually naturally aligned and will have no padding
in them. Instead of marking them with the 'packed' attribute,
assert at compile time that they are the size we expect. This
allows us to take the address of fields within the structs
without risking undefined behaviour, and suppresses clang
-Waddress-of-packed-member warnings.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/ip6.h
slirp/ip6_icmp.h