]> git.proxmox.com Git - mirror_ovs.git/commitdiff
compat: Fix ipv6_dst_lookup build error
authorYi-Hung Wei <yihung.wei@gmail.com>
Wed, 29 Apr 2020 21:25:50 +0000 (14:25 -0700)
committerWilliam Tu <u9012063@gmail.com>
Thu, 30 Apr 2020 18:32:49 +0000 (11:32 -0700)
The geneve/vxlan compat code base invokes ipv6_dst_lookup() which is
recently replaced by ipv6_dst_lookup_flow() in the stable kernel tree.

This causes travis build failure:
    * https://travis-ci.org/github/openvswitch/ovs/builds/681084038

This patch updates the backport logic to invoke the right function.

Related patch in
    git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

b9f3e457098e ("net: ipv6_stub: use ip6_dst_lookup_flow instead of
               ip6_dst_lookup")

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: William Tu <u9012063@gmail.com>
acinclude.m4
datapath/linux/compat/geneve.c
datapath/linux/compat/vxlan.c

index 0e90c333211e497a8d369284fe8b13b15f961e0b..dabbffd01cf726eb5297d2a6081859ac1feff651 100644 (file)
@@ -589,7 +589,10 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
 
   OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup.*net],
                   [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_NET])])
+  OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup_flow.*net],
+                  [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_FLOW_NET])])
   OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
+  OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup_flow])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [ERR_CAST])
   OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [IS_ERR_OR_NULL])
index 1551a37217ec8b24a82645a51f08759576a6da97..7bfc6d8822e5bf802281f041e729f085105465c1 100644 (file)
@@ -962,14 +962,17 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
                        return dst;
        }
 
-#ifdef HAVE_IPV6_DST_LOOKUP_NET
+#if defined(HAVE_IPV6_DST_LOOKUP_FLOW_NET)
+       if (ipv6_stub->ipv6_dst_lookup_flow(geneve->net, gs6->sock->sk, &dst,
+                                            fl6)) {
+#elif defined(HAVE_IPV6_DST_LOOKUP_FLOW)
+       if (ipv6_stub->ipv6_dst_lookup_flow(gs6->sock->sk, &dst, fl6)) {
+#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
        if (ipv6_stub->ipv6_dst_lookup(geneve->net, gs6->sock->sk, &dst, fl6)) {
-#else
-#ifdef HAVE_IPV6_STUB
+#elif defined(HAVE_IPV6_STUB)
        if (ipv6_stub->ipv6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
 #else
        if (ip6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
-#endif
 #endif
                netdev_dbg(dev, "no route to %pI6\n", &fl6->daddr);
                return ERR_PTR(-ENETUNREACH);
index f8f667e9748b5918b1a496407252e38631e70024..b334870b768e824387061ebe96baec9397082010 100644 (file)
@@ -990,17 +990,19 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
        fl6.fl6_dport = dport;
        fl6.fl6_sport = sport;
 
-#ifdef HAVE_IPV6_DST_LOOKUP_NET
-       err = ipv6_stub->ipv6_dst_lookup(vxlan->net,
-                                        sock6->sock->sk,
+#if defined(HAVE_IPV6_DST_LOOKUP_FLOW_NET)
+       err = ipv6_stub->ipv6_dst_lookup_flow(vxlan->net, sock6->sock->sk,
+                                             &ndst, &fl6);
+#elif defined(HAVE_IPV6_DST_LOOKUP_FLOW)
+       err = ipv6_stub->ipv6_dst_lookup_flow(sock6->sock->sk, &ndst, &fl6);
+#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
+       err = ipv6_stub->ipv6_dst_lookup(vxlan->net, sock6->sock->sk,
                                         &ndst, &fl6);
-#else
-#ifdef HAVE_IPV6_STUB
+#elif defined(HAVE_IPV6_STUB)
        err = ipv6_stub->ipv6_dst_lookup(vxlan->vn6_sock->sock->sk,
                                         &ndst, &fl6);
 #else
        err = ip6_dst_lookup(vxlan->vn6_sock->sock->sk, &ndst, &fl6);
-#endif
 #endif
        if (err < 0)
                return ERR_PTR(err);