From 7b6af45c43dd67a8a259c2da3752f8b5ee119972 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 9 Mar 2018 08:56:01 -0500 Subject: [PATCH] CentOS 6 compile fixes closes #486 closes #487 Change-Id: I070726e4048cfaf62ccd797c09ba7e41e75eb180 --- kernel-module/xt_RTPENGINE.c | 14 ++++---------- recording-daemon/garbage.c | 4 ++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/kernel-module/xt_RTPENGINE.c b/kernel-module/xt_RTPENGINE.c index cde9caf30..0ee24473d 100644 --- a/kernel-module/xt_RTPENGINE.c +++ b/kernel-module/xt_RTPENGINE.c @@ -69,6 +69,10 @@ MODULE_LICENSE("GPL"); #define DBG(x...) ((void)0) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) +#define xt_action_param xt_target_param +#endif + #if 0 #define _s_lock(l, f) do { \ printk(KERN_DEBUG "[PID %i %s:%i] acquiring lock %s\n", \ @@ -3848,9 +3852,7 @@ static unsigned int rtpengine46(struct sk_buff *skb, struct rtpengine_table *t, struct sk_buff *skb2; int err; int error_nf_action = XT_CONTINUE; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) int rtp_pt_idx = -2; -#endif unsigned int datalen; u_int32_t *u32; struct rtp_parsed rtp; @@ -4074,11 +4076,7 @@ skip2: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) -static unsigned int rtpengine4(struct sk_buff *oskb, const struct xt_target_param *par) { -#else static unsigned int rtpengine4(struct sk_buff *oskb, const struct xt_action_param *par) { -#endif const struct xt_rtpengine_info *pinfo = par->targinfo; struct sk_buff *skb; struct iphdr *ih; @@ -4119,11 +4117,7 @@ skip: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) -static unsigned int rtpengine6(struct sk_buff *oskb, const struct xt_target_param *par) { -#else static unsigned int rtpengine6(struct sk_buff *oskb, const struct xt_action_param *par) { -#endif const struct xt_rtpengine_info *pinfo = par->targinfo; struct sk_buff *skb; struct ipv6hdr *ih; diff --git a/recording-daemon/garbage.c b/recording-daemon/garbage.c index 0b76b7775..2f02f5a40 100644 --- a/recording-daemon/garbage.c +++ b/recording-daemon/garbage.c @@ -19,7 +19,11 @@ static volatile int garbage_thread_num; unsigned int garbage_new_thread_num(void) { +#if GLIB_CHECK_VERSION(2,30,0) return g_atomic_int_add(&garbage_thread_num, 1); +#else + return g_atomic_int_exchange_and_add(&garbage_thread_num, 1); +#endif }