datapath: stt compatibility for RHEL7
authorPravin B Shelar <pshelar@nicira.com>
Sun, 3 May 2015 18:56:54 +0000 (11:56 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Mon, 4 May 2015 20:21:24 +0000 (13:21 -0700)
RHEL7 backported nf_hookfn from newer kernel. Handle compatibility
by checking nf_hookfn declaration.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
acinclude.m4
datapath/linux/compat/stt.c

index 51cc969..e9d0ed9 100644 (file)
@@ -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])
 
index d68d10e..b44f470 100644 (file)
@@ -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,