ath25: switch default kernel to 5.15
[openwrt/staging/ldir.git] / target / linux / ath79 / patches-5.10 / 910-unaligned_access_hacks.patch
index 52c497e966382cfc501c35be759fa086b4ae3635..2ec0c2b9acadc8d50c5315693541316086b9fa86 100644 (file)
@@ -1,3 +1,47 @@
+From: Felix Fietkau <nbd@openwrt.org>
+Subject: [PATCH] ar71xx: fix unaligned access in a few more places
+
+SVN-Revision: 35130
+---
+ arch/mips/include/asm/checksum.h              | 83 +++---------------
+ include/uapi/linux/ip.h                       |  2 +-
+ include/uapi/linux/ipv6.h                     |  2 +-
+ include/uapi/linux/tcp.h                      |  4 ++--
+ include/uapi/linux/udp.h                      |  2 +-
+ net/netfilter/nf_conntrack_core.c             |  4 ++--
+ include/uapi/linux/icmp.h                     |  2 +-
+ include/uapi/linux/in6.h                      |  2 +-
+ net/ipv6/tcp_ipv6.c                           |  9 +++--
+ net/ipv6/datagram.c                           |  6 ++--
+ net/ipv6/exthdrs.c                            |  2 +-
+ include/linux/types.h                         |  5 +++
+ net/ipv4/af_inet.c                            |  4 ++--
+ net/ipv4/tcp_output.c                         | 69 +++++++++--------
+ include/uapi/linux/igmp.h                     |  8 +++---
+ net/core/flow_dissector.c                     |  2 +-
+ include/uapi/linux/icmpv6.h                   |  2 +-
+ include/net/ndisc.h                           | 10 ++++----
+ net/sched/cls_u32.c                           |  6 +++---
+ net/ipv6/ip6_offload.c                        |  2 +-
+ include/net/addrconf.h                        |  2 +-
+ include/net/inet_ecn.h                        |  4 ++--
+ include/net/ipv6.h                            | 23 +++++----
+ include/net/secure_seq.h                      |  1 +
+ include/uapi/linux/in.h                       |  2 +-
+ net/ipv6/ip6_fib.h                            |  2 +-
+ net/netfilter/nf_conntrack_proto_tcp.c        |  2 +-
+ net/xfrm/xfrm_input.c                         |  4 ++--
+ net/ipv4/tcp_input.c                          | 12 ++++---
+ include/uapi/linux/if_pppox.h                 |  1 +
+ net/ipv6/netfilter/nf_log_ipv6.c              |  4 ++--
+ include/net/neighbour.h                       |  6 +++--
+ include/uapi/linux/netfilter_arp/arp_tables.h |  2 +-
+ net/core/utils.c                              | 10 +++++--
+ include/linux/etherdevice.h                   | 11 ++++---
+ net/ipv4/tcp_offload.c                        |  6 +++---
+ net/ipv6/netfilter/ip6table_mangle.c          |  4 ++--
+ 37 file changed, 171 insertions(+), 141 deletions(-)
+
 --- a/arch/mips/include/asm/checksum.h
 +++ b/arch/mips/include/asm/checksum.h
 @@ -100,26 +100,30 @@ static inline __sum16 ip_fast_csum(const
  
 --- a/include/uapi/linux/ip.h
 +++ b/include/uapi/linux/ip.h
-@@ -103,7 +103,7 @@ struct iphdr {
-       __be32  saddr;
-       __be32  daddr;
+@@ -106,7 +106,7 @@ struct iphdr {
+               __be32  daddr;
+       );
        /*The options start here. */
 -};
 +} __attribute__((packed, aligned(2)));
  struct ip_auth_hdr {
 --- a/include/uapi/linux/ipv6.h
 +++ b/include/uapi/linux/ipv6.h
-@@ -132,7 +132,7 @@ struct ipv6hdr {
-       struct  in6_addr        saddr;
-       struct  in6_addr        daddr;
+@@ -135,7 +135,7 @@ struct ipv6hdr {
+               struct  in6_addr        saddr;
+               struct  in6_addr        daddr;
+       );
 -};
 +} __attribute__((packed, aligned(2)));
  
  #include <linux/uaccess.h>
  #include <linux/ipv6.h>
  #include <linux/icmpv6.h>
-@@ -924,10 +925,10 @@ static void tcp_v6_send_response(const s
+@@ -927,10 +928,10 @@ static void tcp_v6_send_response(const s
        topt = (__be32 *)(t1 + 1);
  
        if (tsecr) {
        }
  
  #ifdef CONFIG_TCP_MD5SIG
---- a/include/linux/ipv6.h
-+++ b/include/linux/ipv6.h
-@@ -6,6 +6,7 @@
- #define ipv6_optlen(p)  (((p)->hdrlen+1) << 3)
- #define ipv6_authlen(p) (((p)->hdrlen+2) << 2)
-+
- /*
-  * This structure contains configuration options per IPv6 link.
-  */
 --- a/net/ipv6/datagram.c
 +++ b/net/ipv6/datagram.c
 @@ -492,7 +492,7 @@ int ipv6_recv_error(struct sock *sk, str
  #endif /* _LINUX_TYPES_H */
 --- a/net/ipv4/af_inet.c
 +++ b/net/ipv4/af_inet.c
-@@ -1470,8 +1470,8 @@ struct sk_buff *inet_gro_receive(struct
+@@ -1469,8 +1469,8 @@ struct sk_buff *inet_gro_receive(struct
        if (unlikely(ip_fast_csum((u8 *)iph, 5)))
                goto out_unlock;
  
        list_for_each_entry(p, head, list) {
 --- a/net/ipv4/tcp_output.c
 +++ b/net/ipv4/tcp_output.c
-@@ -612,48 +612,53 @@ static void tcp_options_write(__be32 *pt
+@@ -609,48 +609,53 @@ static void tcp_options_write(__be32 *pt
        u16 options = opts->options;    /* mungable copy */
  
        if (unlikely(OPTION_MD5 & options)) {
        }
  
        if (unlikely(opts->num_sack_blocks)) {
-@@ -661,16 +666,17 @@ static void tcp_options_write(__be32 *pt
+@@ -658,16 +663,17 @@ static void tcp_options_write(__be32 *pt
                        tp->duplicate_sack : tp->selective_acks;
                int this_sack;
  
                }
  
                tp->rx_opt.dsack = 0;
-@@ -683,13 +689,14 @@ static void tcp_options_write(__be32 *pt
+@@ -680,13 +686,14 @@ static void tcp_options_write(__be32 *pt
  
                if (foc->exp) {
                        len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len;
  struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh)
 --- a/net/netfilter/nf_conntrack_proto_tcp.c
 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -415,7 +415,7 @@ static void tcp_sack(const struct sk_buf
+@@ -412,7 +412,7 @@ static void tcp_sack(const struct sk_buf
  
        /* Fast path for timestamp-only option */
        if (length == TCPOLEN_TSTAMP_ALIGNED
  EXPORT_SYMBOL(xfrm_parse_spi);
 --- a/net/ipv4/tcp_input.c
 +++ b/net/ipv4/tcp_input.c
-@@ -4087,14 +4087,16 @@ static bool tcp_parse_aligned_timestamp(
+@@ -4128,14 +4128,16 @@ static bool tcp_parse_aligned_timestamp(
  {
        const __be32 *ptr = (const __be32 *)(th + 1);
  
                *sum = csum_fold(csum_partial(diff, sizeof(diff),
 --- a/include/linux/etherdevice.h
 +++ b/include/linux/etherdevice.h
-@@ -499,7 +499,7 @@ static inline bool is_etherdev_addr(cons
+@@ -513,7 +513,7 @@ static inline bool is_etherdev_addr(cons
   * @b: Pointer to Ethernet header
   *
   * Compare two Ethernet headers, returns 0 if equal.
   * aligned OR the platform can handle unaligned access.  This is the
   * case for all packets coming into netif_receive_skb or similar
   * entry points.
-@@ -522,11 +522,12 @@ static inline unsigned long compare_ethe
+@@ -536,11 +536,12 @@ static inline unsigned long compare_ethe
        fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
        return fold;
  #else