]> git.proxmox.com Git - ovs.git/commitdiff
datapath: Add missing code in ip_tunnel_lookup()
authorGreg Rose <gvrose8192@gmail.com>
Fri, 29 Jun 2018 03:31:26 +0000 (20:31 -0700)
committerJustin Pettit <jpettit@ovn.org>
Fri, 29 Jun 2018 16:07:46 +0000 (09:07 -0700)
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>
datapath/linux/compat/ip_gre.c
datapath/linux/compat/ip_tunnel.c

index df0217e3b7dde1371ccb6cbf9733aca3905160d7..92de70127189207bfa6728491f649846d0985c37 100644 (file)
@@ -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);
index 5ab6035ed9aef41c5667d8766c8f804e2b8f086d..54af1f178d365c2ed56c7c0a06cb0e5d9646c432 100644 (file)
@@ -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);