From cd7330d06f121afa6151fb000fc8128c01f80a00 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Sun, 3 May 2015 11:56:54 -0700 Subject: [PATCH] datapath: stt compatibility for RHEL7 RHEL7 backported nf_hookfn from newer kernel. Handle compatibility by checking nf_hookfn declaration. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- acinclude.m4 | 2 ++ datapath/linux/compat/stt.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 51cc96985..e9d0ed968 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -325,6 +325,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [can_checksum_protocol]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [netdev_features_t]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [pcpu_sw_netstats]) + OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hookfn.*nf_hook_ops], + [OVS_DEFINE([HAVE_NF_HOOKFN_ARG_OPS])]) OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32]) diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index d68d10eb3..b44f4708f 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -1318,7 +1318,7 @@ static void clean_percpu(struct work_struct *work) schedule_clean_percpu(); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) +#ifdef HAVE_NF_HOOKFN_ARG_OPS #define FIRST_PARAM const struct nf_hook_ops *ops, #else #define FIRST_PARAM unsigned int hooknum, -- 2.20.1