From nobody Tue Oct 28 04:11:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515434703890133.0791487526825; Mon, 8 Jan 2018 10:05:03 -0800 (PST) Received: from localhost ([::1]:48897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbnD-0006N2-57 for importer@patchew.org; Mon, 08 Jan 2018 13:05:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbl2-00054L-Kg for qemu-devel@nongnu.org; Mon, 08 Jan 2018 13:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbky-0006Az-LC for qemu-devel@nongnu.org; Mon, 08 Jan 2018 13:02:48 -0500 Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]:33491) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbky-0006Ai-GP for qemu-devel@nongnu.org; Mon, 08 Jan 2018 13:02:44 -0500 Received: by mail-qt0-x22d.google.com with SMTP id e2so14673627qti.0 for ; Mon, 08 Jan 2018 10:02:44 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id o5sm7919072qtc.72.2018.01.08.10.02.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 10:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=t2laCXOLwU0dgA4VsQeHE6XWtm5WTZhe+iX7QXMYjg4=; b=Hyv27h/PSYZeJQY1qCL3jTwneWzxQ01WKn8rJ9Iw1ytAlLhN1dy+Q6klnqoCP1aYWL EhlQ/jJde7BMcg4ZJN+mbsFceWpMN3kDDUb36+x0reDVj2EQ4d/HROAm5MBM2DnJpfqW IXQrgHPi+nJFgYhJIRag2VC1FV94tvg1vgtCY96CRNHnmZifxbDmYJpIdvw6zaqC9DVb ETHaK7mwHU5Ur8BAsVSxoTnDA4a90Cexs5FrEjFQjujdrKEq3Ze4YmUwuaa1Vamsua8v sfQEhuUQg/mhXzkFmz3LIVzt5SB2F2kQZpzUchLcLJbycrkx/+pzxw4cVbIzn38MtGfw yqJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=t2laCXOLwU0dgA4VsQeHE6XWtm5WTZhe+iX7QXMYjg4=; b=EKphW32Z4nxivpeKz/TIYCnRC/XuxK/NP0bm+ZIXzXId67Mur+SKc0PGR0bgPmm44u T+ebKsj+7ps0kxtAdTZ5/6Rbo/hc5yUj86C/2R6msLZ9bxksXV4wVkjmipv0acCMWois jRzq64J1dEUYnEXls2ERE2lvj+h5zxCkZOXJpbeMKZ9YWDrkcTSGlBOwH8oN+CasjL4c TeJ8wlioH7RGsQCq7NAFOSF2ZiDpEd5L/8aIYG6uLVkJ+S4OWTVk+yGRwRDrYRYAWimD RyY4HyV3jCJsSiuNhRD0HhcH3ACaURF5zMfqNONHzz7oXxnEmEn9MtwoGPOPLZKhIS/R UqVg== X-Gm-Message-State: AKwxytd0BaMoCf/37xeUk13L2XrEMete82n8610dC42O9KcgZVE5cdnW 1VNt2YLuRL/LCdFanGyBMe4= X-Google-Smtp-Source: ACJfBosu0fKp4PJE20cr2/Fwnj57u7PZGMFlbhXV3/PWws6qh35eM7JDtaEwYKvg5lFW4hxTZ/qiAw== X-Received: by 10.237.56.9 with SMTP id j9mr17111394qte.15.1515434563925; Mon, 08 Jan 2018 10:02:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Jiri Pirko , Jason Wang , Dmitry Fleytman Date: Mon, 8 Jan 2018 15:02:26 -0300 Message-Id: <20180108180231.21122-3-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108180231.21122-1-f4bug@amsat.org> References: <20180108180231.21122-1-f4bug@amsat.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22d Subject: [Qemu-devel] [PATCH 2/7] net/eth: use the QEMU_PACKED macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" --- 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; =20 struct vlan_header { uint16_t h_tci; /* priority and VLAN ID */ uint16_t h_proto; /* encapsulated protocol */ -}; +} QEMU_PACKED; =20 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; =20 -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) =20 -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; =20 -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; =20 -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; =20 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; =20 struct ip6_option_hdr { #define IP6_OPT_PAD1 (0x00) #define IP6_OPT_HOME (0xC9) uint8_t type; uint8_t len; -}; +} QEMU_PACKED; =20 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; =20 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; =20 #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt #define ip6_ecn_acc ip6_ctlun.ip6_un3.ip6_un3_ecn --=20 2.15.1