From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Jiri Pirko <jiri@resnulli.us>, Jason Wang <jasowang@redhat.com>,
Dmitry Fleytman <dmitry@daynix.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, "Eric Blake" <eblake@redhat.com>
Subject: [Qemu-devel] [PATCH 2/7] net/eth: use the QEMU_PACKED macro
Date: Mon, 8 Jan 2018 15:02:26 -0300 [thread overview]
Message-ID: <20180108180231.21122-3-f4bug@amsat.org> (raw)
In-Reply-To: <20180108180231.21122-1-f4bug@amsat.org>
---
include/net/eth.h | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/include/net/eth.h b/include/net/eth.h
index 09054a506d..87c6499f18 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -36,12 +36,12 @@ struct eth_header {
uint8_t h_dest[ETH_ALEN]; /* destination eth addr */
uint8_t h_source[ETH_ALEN]; /* source ether addr */
uint16_t h_proto; /* packet type ID field */
-};
+} QEMU_PACKED;
struct vlan_header {
uint16_t h_tci; /* priority and VLAN ID */
uint16_t h_proto; /* encapsulated protocol */
-};
+} QEMU_PACKED;
struct ip_header {
uint8_t ip_ver_len; /* version and header length */
@@ -53,9 +53,9 @@ struct ip_header {
uint8_t ip_p; /* protocol */
uint16_t ip_sum; /* checksum */
uint32_t ip_src, ip_dst; /* source and destination address */
-};
+} QEMU_PACKED;
-typedef struct tcp_header {
+typedef struct QEMU_PACKED tcp_header {
uint16_t th_sport; /* source port */
uint16_t th_dport; /* destination port */
uint32_t th_seq; /* sequence number */
@@ -77,14 +77,14 @@ typedef struct tcp_header {
#define TCP_HEADER_DATA_OFFSET(tcp) \
(((be16_to_cpu((tcp)->th_offset_flags) >> 12) & 0xf) << 2)
-typedef struct udp_header {
+typedef struct QEMU_PACKED udp_header {
uint16_t uh_sport; /* source port */
uint16_t uh_dport; /* destination port */
uint16_t uh_ulen; /* udp length */
uint16_t uh_sum; /* udp checksum */
} udp_header;
-typedef struct ip_pseudo_header {
+typedef struct QEMU_PACKED ip_pseudo_header {
uint32_t ip_src;
uint32_t ip_dst;
uint8_t zeros;
@@ -116,9 +116,9 @@ struct ip6_header {
} ip6_ctlun;
struct in6_address ip6_src; /* source address */
struct in6_address ip6_dst; /* destination address */
-};
+} QEMU_PACKED;
-typedef struct ip6_pseudo_header {
+typedef struct QEMU_PACKED ip6_pseudo_header {
struct in6_address ip6_src;
struct in6_address ip6_dst;
uint32_t len;
@@ -129,7 +129,7 @@ typedef struct ip6_pseudo_header {
struct ip6_ext_hdr {
uint8_t ip6r_nxt; /* next header */
uint8_t ip6r_len; /* length in units of 8 octets */
-};
+} QEMU_PACKED;
struct ip6_ext_hdr_routing {
uint8_t nxt;
@@ -137,21 +137,21 @@ struct ip6_ext_hdr_routing {
uint8_t rtype;
uint8_t segleft;
uint8_t rsvd[4];
-};
+} QEMU_PACKED;
struct ip6_option_hdr {
#define IP6_OPT_PAD1 (0x00)
#define IP6_OPT_HOME (0xC9)
uint8_t type;
uint8_t len;
-};
+} QEMU_PACKED;
struct udp_hdr {
uint16_t uh_sport; /* source port */
uint16_t uh_dport; /* destination port */
uint16_t uh_ulen; /* udp length */
uint16_t uh_sum; /* udp checksum */
-};
+} QEMU_PACKED;
struct tcp_hdr {
u_short th_sport; /* source port */
@@ -180,7 +180,7 @@ struct tcp_hdr {
u_short th_win; /* window */
u_short th_sum; /* checksum */
u_short th_urp; /* urgent pointer */
-};
+} QEMU_PACKED;
#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
#define ip6_ecn_acc ip6_ctlun.ip6_un3.ip6_un3_ecn
--
2.15.1
next prev parent reply other threads:[~2018-01-08 18:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 18:02 [Qemu-devel] [PATCH 0/7] use QEMU_PACKED and QEMU_ALIGNED macros Philippe Mathieu-Daudé
2018-01-08 18:02 ` [Qemu-devel] [PATCH 1/7] net: struct MACAddr can use the QEMU_PACKED macro Philippe Mathieu-Daudé
2018-01-09 16:26 ` Richard Henderson
2018-01-08 18:02 ` Philippe Mathieu-Daudé [this message]
2018-01-08 18:02 ` [Qemu-devel] [PATCH 3/7] net/rocker: use QEMU_PACKED and QEMU_ALIGNED() macros Philippe Mathieu-Daudé
2018-01-09 16:27 ` Richard Henderson
2018-01-08 18:02 ` [Qemu-devel] [PATCH 4/7] net/rocker: move struct rocker_desc to C file Philippe Mathieu-Daudé
2018-01-09 16:27 ` Richard Henderson
2018-01-08 18:02 ` [Qemu-devel] [PATCH 5/7] net/eepro100: use QEMU_ALIGNED() macro Philippe Mathieu-Daudé
2018-01-09 16:27 ` Richard Henderson
2018-01-08 18:02 ` [Qemu-devel] [RFC PATCH 6/7] net/eepro100: reduce alignment to DWORD (32bit) Philippe Mathieu-Daudé
2018-01-08 18:10 ` Paolo Bonzini
2018-01-08 18:28 ` Philippe Mathieu-Daudé
2018-01-08 18:02 ` [Qemu-devel] [PATCH 7/7] i386/pc: use the QEMU_ALIGNED() macro Philippe Mathieu-Daudé
2018-01-08 18:53 ` Marcel Apfelbaum
2018-01-09 16:28 ` Richard Henderson
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=20180108180231.21122-3-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=dmitry@daynix.com \
--cc=eblake@redhat.com \
--cc=jasowang@redhat.com \
--cc=jiri@resnulli.us \
--cc=qemu-devel@nongnu.org \
/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).