summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorGreg Rose <gvrose8192@gmail.com>2018-06-28 20:31:26 -0700
committerJustin Pettit <jpettit@ovn.org>2018-06-29 09:07:46 -0700
commit6690de401904217e9c824197b0aa84d68d2c363a (patch)
treeb58c84a82eab023e34e7180257b53e7aaba26ed0 /datapath
parent56174c2bf4577eacdfaef8c77ea82c99e29e4a30 (diff)
downloadopenvswitch-6690de401904217e9c824197b0aa84d68d2c363a.tar.gz
datapath: Add missing code in ip_tunnel_lookup()
The compat rpl_ip_tunnel_lookup() function was missing some code added in Linux kernel release 4.3 but not backported in the initial commit. This also allows us to remove an old hack in erspan_rcv() that was zeroing out the key parameter so that the tunnel lookups wouldn't fail. Fixes: 8e53509c ("gre: introduce native tunnel support for ERSPAN") Reported-by: William Tu <u9012063@gmail.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: William Tu <u9012063@gmail.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/linux/compat/ip_gre.c3
-rw-r--r--datapath/linux/compat/ip_tunnel.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index df0217e3b..92de70127 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -208,10 +208,9 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
* Use ERSPAN 10-bit session ID as key.
*/
tpi->key = cpu_to_be32(get_session_id(ershdr));
- /* OVS doesn't set tunnel key - so don't bother with it */
tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex,
tpi->flags,
- iph->saddr, iph->daddr, 0);
+ iph->saddr, iph->daddr, tpi->key);
if (tunnel) {
len = gre_hdr_len + erspan_hdr_len(ver);
diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c
index 5ab6035ed..54af1f178 100644
--- a/datapath/linux/compat/ip_tunnel.c
+++ b/datapath/linux/compat/ip_tunnel.c
@@ -749,6 +749,10 @@ skip_key_lookup:
if (cand)
return cand;
+ t = rcu_dereference(itn->collect_md_tun);
+ if (t)
+ return t;
+
if (itn->fb_tunnel_dev && itn->fb_tunnel_dev->flags & IFF_UP)
return netdev_priv(itn->fb_tunnel_dev);