mirror of
https://github.com/openvswitch/ovs
synced 2025-10-23 14:57:06 +00:00
compat: Detect and use struct nf_conntrack_zone.
Rather than relying on version checks, detect the presence of this structure and use it if available. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Pravin B Shelar <pshelar@ovn.org>
This commit is contained in:
@@ -392,6 +392,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
|
||||
OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
|
||||
[tmpl_alloc.*conntrack_zone],
|
||||
[OVS_DEFINE([HAVE_NF_CT_TMPL_ALLOC_TAKES_STRUCT_ZONE])])
|
||||
OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_zones.h],
|
||||
[nf_ct_zone_init])
|
||||
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32])
|
||||
OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include_next <net/netfilter/nf_conntrack_expect.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
|
||||
#ifndef HAVE_NF_CT_ZONE_INIT
|
||||
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
#include <net/netfilter/nf_conntrack_zones.h>
|
||||
@@ -17,5 +17,5 @@ rpl___nf_ct_expect_find(struct net *net,
|
||||
}
|
||||
#define __nf_ct_expect_find rpl___nf_ct_expect_find
|
||||
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */
|
||||
#endif /* HAVE_NF_CT_ZONE_INIT */
|
||||
#endif /* _NF_CONNTRACK_EXPECT_WRAPPER_H */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include_next <net/netfilter/nf_conntrack_zones.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
|
||||
#ifndef HAVE_NF_CT_ZONE_INIT
|
||||
|
||||
#include <linux/kconfig.h>
|
||||
#include <linux/types.h>
|
||||
@@ -99,5 +99,5 @@ static inline bool nf_ct_zone_equal_any(const struct nf_conn *a,
|
||||
return nf_ct_zone(a)->id == b->id;
|
||||
}
|
||||
#endif /* IS_ENABLED(CONFIG_NF_CONNTRACK) */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */
|
||||
#endif /* HAVE_NF_CT_ZONE_INIT */
|
||||
#endif /* _NF_CONNTRACK_ZONES_WRAPPER_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
|
||||
#ifndef HAVE_NF_CT_ZONE_INIT
|
||||
|
||||
#include <net/netfilter/nf_conntrack_zones.h>
|
||||
|
||||
@@ -10,4 +10,4 @@ const struct nf_conntrack_zone nf_ct_zone_dflt = {
|
||||
.dir = NF_CT_DEFAULT_ZONE_DIR,
|
||||
};
|
||||
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */
|
||||
#endif /* HAVE_NF_CT_ZONE_INIT */
|
||||
|
||||
Reference in New Issue
Block a user