]> git.proxmox.com Git - ovs.git/commitdiff
datapath: Remove untracked CT on newer kernels.
authorJoe Stringer <joe@ovn.org>
Wed, 3 May 2017 18:53:29 +0000 (11:53 -0700)
committerJoe Stringer <joe@ovn.org>
Wed, 3 May 2017 23:09:04 +0000 (16:09 -0700)
Upstream commits cc41c84b7e7f ("netfilter: kill the fake untracked
conntrack objects") and ab8bc7ed864b ("netfilter: remove
nf_ct_is_untracked") removed the 'untracked' conntrack objects and
functions. The latter commit removes the usage of nf_ct_is_untracked()
from OVS. However, older kernels still have a representation of
'untracked' CT objects so the code needs to remain until the kernel
support is bumped to Linux 4.12 or newer. Introduce a macro to detect
this symbol and wrap these lines in the macro check.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Greg Rose <gvrose8192@gmail.com>
acinclude.m4
datapath/conntrack.c

index dbe03bc83e4327ec9c8969852e8ed4bed8d2490d..d9a8a58372f01fbf98f386ba644a8f07b7fc523a 100644 (file)
@@ -541,6 +541,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
                   [OVS_DEFINE([HAVE_NF_CT_GET_TUPLEPR_TAKES_STRUCT_NET])])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
                   [nf_ct_set])
+  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
+                  [nf_ct_is_untracked])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_zones.h],
                   [nf_ct_zone_init])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
index 64ad0657241bd9fcb3b00b218ead77e7868829a3..bf28fc071929d5c3ad04753ac21edaa9cfc3031a 100644 (file)
@@ -859,10 +859,12 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key,
        enum nf_nat_manip_type maniptype;
        int err;
 
+#ifdef HAVE_NF_CT_IS_UNTRACKED
        if (nf_ct_is_untracked(ct)) {
                /* A NAT action may only be performed on tracked packets. */
                return NF_ACCEPT;
        }
+#endif /* HAVE_NF_CT_IS_UNTRACKED */
 
        /* Add NAT extension if not confirmed yet. */
        if (!nf_ct_is_confirmed(ct) && !nf_ct_nat_ext_add(ct))