--- zzzz-none-000/linux-4.4.60/net/ipv6/ip6_gre.c 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/net/ipv6/ip6_gre.c 2021-02-04 17:41:59.000000000 +0000 @@ -57,7 +57,6 @@ #include #include - static bool log_ecn_error = true; module_param(log_ecn_error, bool, 0644); MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); @@ -366,7 +365,6 @@ dev_put(dev); } - static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt, u8 type, u8 code, int offset, __be32 info) { @@ -398,7 +396,7 @@ key = key_off ? *(__be32 *)(skb->data + key_off) : 0; t = ip6gre_tunnel_lookup(skb->dev, &ipv6h->daddr, &ipv6h->saddr, - key, greh->protocol); + key, greh->protocol); if (!t) return; @@ -479,11 +477,11 @@ offset += 4; } if (flags&GRE_KEY) { - key = *(__be32 *)(h + offset); + key = net_hdr_word(h + offset); offset += 4; } if (flags&GRE_SEQ) { - seqno = ntohl(*(__be32 *)(h + offset)); + seqno = ntohl(net_hdr_word(h + offset)); offset += 4; } } @@ -745,7 +743,7 @@ if (tunnel->parms.o_flags&GRE_SEQ) { ++tunnel->o_seqno; - *ptr = htonl(tunnel->o_seqno); + net_hdr_word(ptr) = htonl(tunnel->o_seqno); ptr--; } if (tunnel->parms.o_flags&GRE_KEY) { @@ -760,7 +758,7 @@ } skb_set_inner_protocol(skb, protocol); - + skb->skb_iif = dev->ifindex; ip6tunnel_xmit(NULL, skb, dev); return 0; tx_err_link_failure: @@ -841,7 +839,7 @@ dsfield = ipv6_get_dsfield(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) - fl6.flowlabel |= (*(__be32 *) ipv6h & IPV6_TCLASS_MASK); + fl6.flowlabel |= net_hdr_word(ipv6h) & IPV6_TCLASS_MASK; if (t->parms.flags & IP6_TNL_F_USE_ORIG_FLOWLABEL) fl6.flowlabel |= ip6_flowlabel(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) @@ -1305,7 +1303,6 @@ dev_hold(dev); } - static struct inet6_protocol ip6gre_protocol __read_mostly = { .handler = ip6gre_rcv, .err_handler = ip6gre_err, @@ -1361,7 +1358,6 @@ */ ign->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL; - ip6gre_fb_tunnel_init(ign->fb_tunnel_dev); ign->fb_tunnel_dev->rtnl_link_ops = &ip6gre_link_ops; @@ -1438,7 +1434,6 @@ return ip6gre_tunnel_validate(tb, data); } - static void ip6gre_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { @@ -1515,7 +1510,7 @@ dev->netdev_ops = &ip6gre_tap_netdev_ops; dev->destructor = ip6gre_dev_free; - + dev->priv_flags |= IFF_GRE_V6_TAP; dev->features |= NETIF_F_NETNS_LOCAL; }