qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>, Thomas Huth <thuth@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 01/12] slirp: remove QEMU_PACKED from structures with don't require it
Date: Mon,  8 Jan 2018 14:28:53 -0300	[thread overview]
Message-ID: <20180108172904.8772-2-f4bug@amsat.org> (raw)
In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org>

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 <programmingkidx@gmail.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@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

  reply	other threads:[~2018-01-08 17:29 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 17:28 [Qemu-devel] [PATCH 00/12] add HOST_SUPPORTS_UNALIGNED_ACCESS, reduce slirp warnings Philippe Mathieu-Daudé
2018-01-08 17:28 ` Philippe Mathieu-Daudé [this message]
2018-01-08 20:13   ` [Qemu-devel] [PATCH 01/12] slirp: remove QEMU_PACKED from structures with don't require it Thomas Huth
2018-01-09 20:54   ` Samuel Thibault
2018-01-08 17:28 ` [Qemu-devel] [PATCH 02/12] slirp: struct icmp/ethhdr ARE packed Philippe Mathieu-Daudé
2018-01-08 17:43   ` Thomas Huth
2018-01-08 17:28 ` [Qemu-devel] [PATCH 03/12] slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero() Philippe Mathieu-Daudé
2018-01-09 21:04   ` Samuel Thibault
2018-01-08 17:28 ` [Qemu-devel] [PATCH 04/12] slirp: add in6_multicast() and use it instead of IN6_IS_ADDR_MULTICAST() Philippe Mathieu-Daudé
2018-01-08 20:10   ` Thomas Huth
2018-01-09 16:33   ` Richard Henderson
2018-01-09 17:08     ` Thomas Huth
2018-01-09 21:18     ` Samuel Thibault
2018-01-08 17:28 ` [Qemu-devel] [PATCH 05/12] slirp: poison IN6_*_ADDR_*() macros to avoid them Philippe Mathieu-Daudé
2018-01-08 17:46   ` Thomas Huth
2018-01-08 17:28 ` [Qemu-devel] [PATCH 06/12] slirp: remove unused header Philippe Mathieu-Daudé
2018-01-08 18:54   ` Thomas Huth
2018-01-09 21:21     ` Samuel Thibault
2018-01-08 17:28 ` [Qemu-devel] [PATCH 07/12] slirp: remove unnecessary Philippe Mathieu-Daudé
2018-01-08 19:01   ` Thomas Huth
2018-01-09 21:23     ` Samuel Thibault
2018-01-08 17:29 ` [Qemu-devel] [PATCH 08/12] slirp: removed unused code Philippe Mathieu-Daudé
2018-01-08 19:02   ` Thomas Huth
2018-01-09 21:24     ` Samuel Thibault
2018-01-08 17:29 ` [Qemu-devel] [PATCH 09/12] slirp: add in6_dhcp_multicast() Philippe Mathieu-Daudé
2018-01-09 21:26   ` Samuel Thibault
2018-01-08 17:29 ` [Qemu-devel] [PATCH 10/12] configure: disable unaligned access warning on x86 arch Philippe Mathieu-Daudé
2018-01-08 17:32   ` Peter Maydell
2018-01-08 17:53     ` Michael S. Tsirkin
2018-01-08 18:24     ` Philippe Mathieu-Daudé
2018-01-08 17:29 ` [Qemu-devel] [PATCH 11/12] configure: add HOST_SUPPORTS_UNALIGNED_ACCESS Philippe Mathieu-Daudé
2018-01-08 17:29 ` [Qemu-devel] [RFC PATCH 12/12] slirp: use HOST_SUPPORTS_UNALIGNED_ACCESS Philippe Mathieu-Daudé
2018-01-09  9:52   ` Paolo Bonzini
2018-01-09 21:30   ` Samuel Thibault
2018-01-08 19:41 ` [Qemu-devel] [PATCH 00/12] add HOST_SUPPORTS_UNALIGNED_ACCESS, reduce slirp warnings no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180108172904.8772-2-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=eblake@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).