summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2009-01-17 00:25:24 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2009-01-17 00:25:24 +0100
commita1b4aa27c0efcc8d8c6d582d7eed1e014b424088 (patch)
tree44e5425e6c650896bf835374c513195792d189ab
parent6a5878a3748d84d95e15b9a8b018e1bfc54fc894 (diff)
2.4.6v2.4.6
Compatibility fix for kernels >= 2.6.28
-rw-r--r--Makefile2
-rw-r--r--kernel/ChangeLog3
-rw-r--r--kernel/ipt_SET.c30
-rw-r--r--kernel/ipt_set.c28
4 files changed, 54 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index fbe20a2..7d2fd6e 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ ifndef V
V=0
endif
-IPSET_VERSION:=2.4.5
+IPSET_VERSION:=2.4.6
PREFIX:=/usr/local
LIBDIR:=$(PREFIX)/lib
diff --git a/kernel/ChangeLog b/kernel/ChangeLog
index 178339b..2c5c0dd 100644
--- a/kernel/ChangeLog
+++ b/kernel/ChangeLog
@@ -1,3 +1,6 @@
+2.4.6
+ - Compatibility fix for kernels >= 2.6.28
+
2.4.5
- setlist type does not work properly together with swapping
sets, bug reported by Thomas Jacob.
diff --git a/kernel/ipt_SET.c b/kernel/ipt_SET.c
index a6cad1d..cd89beb 100644
--- a/kernel/ipt_SET.c
+++ b/kernel/ipt_SET.c
@@ -57,16 +57,23 @@ target(struct sk_buff **pskb,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo)
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
target(struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
unsigned int hooknum,
const struct xt_target *target,
const void *targinfo)
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) */
+target(struct sk_buff *skb,
+ const struct xt_target_param *par)
#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
const struct ipt_set_info_target *info = targinfo;
+#else
+ const struct ipt_set_info_target *info = par->targinfo;
+#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
struct sk_buff *skb = *pskb;
#endif
@@ -113,16 +120,23 @@ checkentry(const char *tablename,
const struct xt_target *target,
void *targinfo,
unsigned int hook_mask)
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
static bool
checkentry(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int hook_mask)
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) */
+static bool
+checkentry(const struct xt_tgchk_param *par)
#endif
{
- struct ipt_set_info_target *info = targinfo;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+ const struct ipt_set_info_target *info = targinfo;
+#else
+ const struct ipt_set_info_target *info = par->targinfo;
+#endif
ip_set_id_t index;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
@@ -165,12 +179,18 @@ static void destroy(void *targetinfo,
static void destroy(const struct xt_target *target,
void *targetinfo,
unsigned int targetsize)
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
static void destroy(const struct xt_target *target,
void *targetinfo)
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) */
+static void destroy(const struct xt_tgdtor_param *par)
#endif
{
- struct ipt_set_info_target *info = targetinfo;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+ const struct ipt_set_info_target *info = targinfo;
+#else
+ const struct ipt_set_info_target *info = par->targinfo;
+#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
if (targetsize != IPT_ALIGN(sizeof(struct ipt_set_info_target))) {
diff --git a/kernel/ipt_set.c b/kernel/ipt_set.c
index 114f973..2f97cbb 100644
--- a/kernel/ipt_set.c
+++ b/kernel/ipt_set.c
@@ -73,7 +73,7 @@ match(const struct sk_buff *skb,
int offset,
unsigned int protoff,
int *hotdrop)
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
static bool
match(const struct sk_buff *skb,
const struct net_device *in,
@@ -83,9 +83,17 @@ match(const struct sk_buff *skb,
int offset,
unsigned int protoff,
bool *hotdrop)
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) */
+static bool
+match(const struct sk_buff *skb,
+ const struct xt_match_param *par)
#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
const struct ipt_set_info_match *info = matchinfo;
+#else
+ const struct ipt_set_info_match *info = par->matchinfo;
+#endif
return match_set(&info->match_set,
skb,
@@ -121,16 +129,23 @@ checkentry(const char *tablename,
const struct xt_match *match,
void *matchinfo,
unsigned int hook_mask)
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
static bool
checkentry(const char *tablename,
const void *inf,
const struct xt_match *match,
void *matchinfo,
unsigned int hook_mask)
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) */
+static bool
+checkentry(const struct xt_mtchk_param *par)
#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
struct ipt_set_info_match *info = matchinfo;
+#else
+ struct ipt_set_info_match *info = par->matchinfo;
+#endif
ip_set_id_t index;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
@@ -162,12 +177,19 @@ static void destroy(void *matchinfo,
static void destroy(const struct xt_match *match,
void *matchinfo,
unsigned int matchsize)
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
static void destroy(const struct xt_match *match,
void *matchinfo)
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) */
+static void destroy(const struct xt_mtdtor_param *par)
#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
struct ipt_set_info_match *info = matchinfo;
+#else
+ struct ipt_set_info_match *info = par->matchinfo;
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
if (matchsize != IPT_ALIGN(sizeof(struct ipt_set_info_match))) {