public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sergei Antonov <saproj@gmail.com>
To: u-boot@lists.denx.de, v.v.mitrofanov@yadro.com
Cc: Sergei Antonov <saproj@gmail.com>
Subject: [PATCH] net: ipv6: fix alignment errors on ARM
Date: Wed, 18 Jan 2023 20:52:18 +0300	[thread overview]
Message-ID: <20230118175218.31683-1-saproj@gmail.com> (raw)

Commands "ping6" and "tftpboot ... -ipv6" did not work on ARM because
machine code expects 4-byte alignment and some structures from net6.h
are not aligned in memory.

Fix by adding __packed, since it is already used in this file.

Signed-off-by: Sergei Antonov <saproj@gmail.com>
---
 include/net6.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net6.h b/include/net6.h
index 9b3de028e6dc..2d7c5a096046 100644
--- a/include/net6.h
+++ b/include/net6.h
@@ -24,7 +24,7 @@ struct in6_addr {
 #define s6_addr		in6_u.u6_addr8
 #define s6_addr16	in6_u.u6_addr16
 #define s6_addr32	in6_u.u6_addr32
-};
+} __packed;
 
 #define IN6ADDRSZ	sizeof(struct in6_addr)
 #define INETHADDRSZ	sizeof(net_ethaddr)
@@ -62,7 +62,7 @@ struct ip6_hdr {
 	u8		hop_limit;
 	struct in6_addr	saddr;
 	struct in6_addr	daddr;
-};
+} __packed;
 #define IP6_HDR_SIZE (sizeof(struct ip6_hdr))
 
 /* struct udp_hdr - User Datagram Protocol header */
@@ -164,7 +164,7 @@ struct icmp6hdr {
 #define icmp6_addrconf_managed	icmp6_dataun.u_nd_ra.managed
 #define icmp6_addrconf_other	icmp6_dataun.u_nd_ra.other
 #define icmp6_rt_lifetime	icmp6_dataun.u_nd_ra.rt_lifetime
-};
+} __packed;
 
 extern struct in6_addr const net_null_addr_ip6;	/* NULL IPv6 address */
 extern struct in6_addr net_gateway6;	/* Our gateways IPv6 address */
-- 
2.34.1


             reply	other threads:[~2023-01-18 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 17:52 Sergei Antonov [this message]
2023-01-19  8:18 ` [PATCH] net: ipv6: fix alignment errors on ARM Vyacheslav V. Mitrofanov
2023-01-19 11:05   ` Sergei Antonov
2023-01-19 11:56     ` Vyacheslav V. Mitrofanov
2023-02-03 18:20 ` Tom Rini

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=20230118175218.31683-1-saproj@gmail.com \
    --to=saproj@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=v.v.mitrofanov@yadro.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