summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2018-03-02 11:06:52 -0800
committerBen Pfaff <blp@ovn.org>2018-05-21 20:33:29 -0700
commite289f5e0394aa795b4e190725e480079924ae724 (patch)
tree594505f2cc616ef7980c607b18822f62e76eb9a4 /datapath
parentbf3eff8d15d398450211fb21a1c57e2ba60fbf19 (diff)
downloadopenvswitch-e289f5e0394aa795b4e190725e480079924ae724.tar.gz
ip_gre: erspan: reload pointer after pskb_may_pull
Upstream commit: commit d91e8db5b629a3c8c81db4dc317a66c7b5591821 Author: William Tu <u9012063@gmail.com> Date: Fri Dec 15 14:27:44 2017 -0800 net: erspan: reload pointer after pskb_may_pull pskb_may_pull() can change skb->data, so we need to re-load pkt_md and ershdr at the right place. Fixes: 94d7d8f29287 ("ip6_gre: add erspan v2 support") Fixes: f551c91de262 ("net: erspan: introduce erspan v2 for ip_gre") Signed-off-by: William Tu <u9012063@gmail.com> Cc: Haishuang Yan <yanhaishuang@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net> Only the ip_gre portion of the upstream commit. The ipv6 portion is pulled in with later patch in series. Cc: William Tu <u9012063@gmail.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/linux/compat/ip_gre.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index c7912cf98..028586c15 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -225,6 +225,9 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
if (unlikely(!pskb_may_pull(skb, len)))
return PACKET_REJECT;
+ ershdr = (struct erspan_base_hdr *)skb->data;
+ pkt_md = (struct erspan_metadata *)(ershdr + 1);
+
if (__iptunnel_pull_header(skb,
len,
htons(ETH_P_TEB),