--- zzzz-none-000/linux-2.6.39.4/net/ipv4/gre.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-atom-6490-729/linux-2.6.39.4/net/ipv4/gre.c 2021-11-10 13:38:18.000000000 +0000 @@ -9,6 +9,10 @@ * 2 of the License, or (at your option) any later version. * */ +/* + Includes Intel Corporation's changes/modifications dated: 3/9/2014. + Changed/modified portions - Copyright © 2014, Intel Corporation +*/ #include #include @@ -18,6 +22,7 @@ #include #include #include +#include #include #include @@ -96,28 +101,18 @@ static void gre_err(struct sk_buff *skb, u32 info) { - const struct gre_protocol *proto; - u8 ver; - if (!pskb_may_pull(skb, 12)) - goto drop; + const struct gre_protocol *proto; + const struct iphdr *iph = (const struct iphdr *)skb->data; + u8 ver = skb->data[(iph->ihl<<2) + 1]&0x7f; - ver = skb->data[1]&0x7f; if (ver >= GREPROTO_MAX) - goto drop; - + return; rcu_read_lock(); proto = rcu_dereference(gre_proto[ver]); - if (!proto || !proto->err_handler) - goto drop_unlock; + if (proto && proto->err_handler) proto->err_handler(skb, info); rcu_read_unlock(); - return; - -drop_unlock: - rcu_read_unlock(); -drop: - kfree_skb(skb); } static const struct net_protocol net_gre_protocol = {