theses structures are not serialized and often store host pointers. slirp/ip_input.c:159:43: warning: taking address of packed member 'ip_link' of class or structure 'ipq' may result in an unaligned pointer value [-Waddress-of-packed-member] for (l = slirp->ipq.ip_link.next; l != &slirp->ipq.ip_link; ^~~~~~~~~~~~~~~~~~
Reported-by: John Arbuckle <programmingk...@gmail.com> Suggested-by: Peter Maydell <peter.mayd...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- slirp/ip.h | 10 +++++----- slirp/slirp.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/slirp/ip.h b/slirp/ip.h index 1df6723357..e29ccd3c9f 100644 --- a/slirp/ip.h +++ b/slirp/ip.h @@ -179,11 +179,11 @@ struct ip_timestamp { struct mbuf_ptr { struct mbuf *mptr; uint32_t dummy; -} QEMU_PACKED; +}; #else struct mbuf_ptr { struct mbuf *mptr; -} QEMU_PACKED; +}; #endif struct qlink { void *next, *prev; @@ -199,7 +199,7 @@ struct ipovly { uint16_t ih_len; /* protocol length */ struct in_addr ih_src; /* source internet address */ struct in_addr ih_dst; /* destination internet address */ -} QEMU_PACKED; +}; /* * Ip reassembly queue structure. Each fragment @@ -215,7 +215,7 @@ struct ipq { uint8_t ipq_p; /* protocol of this fragment */ uint16_t ipq_id; /* sequence id for reassembly */ struct in_addr ipq_src,ipq_dst; -} QEMU_PACKED; +}; /* * Ip header, when holding a fragment. @@ -225,7 +225,7 @@ struct ipq { struct ipasfrag { struct qlink ipf_link; struct ip ipf_ip; -} QEMU_PACKED; +}; #define ipf_off ipf_ip.ip_off #define ipf_tos ipf_ip.ip_tos diff --git a/slirp/slirp.h b/slirp/slirp.h index 898ec9516d..9f29b52610 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -136,7 +136,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, struct ndpentry { unsigned char eth_addr[ETH_ALEN]; /* sender hardware address */ struct in6_addr ip_addr; /* sender IP address */ -} QEMU_PACKED; +}; #define NDP_TABLE_SIZE 16 -- 2.15.1