Explorar o código

ar71xx: fix packed-not-aligned error with GCC 8.

Building ar71xx currently fails with:

    In file included from ./include/linux/ipv6.h:5,
                     from ./include/net/ipv6.h:16,
                     from ./include/net/inetpeer.h:16,
                     from ./include/net/ip_fib.h:24,
                     from ./include/net/switchdev.h:17,
                     from ./include/net/dsa.h:23,
                     from arch/mips/ath79/dev-dsa.h:15,
                     from arch/mips/ath79/dev-dsa.c:17:
    ./include/uapi/linux/ipv6.h:107:1: error: alignment 1 of 'struct ipv6_destopt_hao' is less than 2 [-Werror=packed-not-aligned]
     } __attribute__((packed));

Address this issue by correcting the alignment of the struct packing
pragma accordingly.

Fixes: FS#1805
Reported-by: Pascal Ernster <[email protected]>
[reword subject, rewrap commit message]
Signed-off-by: Jo-Philipp Wich <[email protected]>
Jo-Philipp Wich %!s(int64=7) %!d(string=hai) anos
pai
achega
19850b639e

+ 9 - 0
target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch

@@ -129,6 +129,15 @@
  struct ip_auth_hdr {
  struct ip_auth_hdr {
 --- a/include/uapi/linux/ipv6.h
 --- a/include/uapi/linux/ipv6.h
 +++ b/include/uapi/linux/ipv6.h
 +++ b/include/uapi/linux/ipv6.h
+@@ -104,7 +104,7 @@ struct ipv6_destopt_hao {
+ 	__u8			type;
+ 	__u8			length;
+ 	struct in6_addr		addr;
+-} __attribute__((packed));
++} __attribute__((packed, aligned(2)));
+ 
+ /*
+  *	IPv6 fixed header
 @@ -131,7 +131,7 @@ struct ipv6hdr {
 @@ -131,7 +131,7 @@ struct ipv6hdr {
  
  
  	struct	in6_addr	saddr;
  	struct	in6_addr	saddr;