--- zzzz-none-000/linux-4.4.60/net/ipv6/ip6_gre.c 2017-04-08 07:53:53.000000000 +0000 +++ dragonfly-4020-701/linux-4.4.60/net/ipv6/ip6_gre.c 2018-11-08 13:36:17.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,9 @@ key = key_off ? *(__be32 *)(skb->data + key_off) : 0; t = ip6gre_tunnel_lookup(skb->dev, &ipv6h->daddr, &ipv6h->saddr, - key, greh->protocol); + flags & GRE_KEY ? + net_hdr_word(((__be32 *)p) + (grehlen / 4) - 1) : 0, + p[1]); if (!t) return; @@ -479,11 +479,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 +745,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) { @@ -841,7 +841,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 +1305,6 @@ dev_hold(dev); } - static struct inet6_protocol ip6gre_protocol __read_mostly = { .handler = ip6gre_rcv, .err_handler = ip6gre_err, @@ -1361,7 +1360,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 +1436,6 @@ return ip6gre_tunnel_validate(tb, data); } - static void ip6gre_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { @@ -1515,7 +1512,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; }