Remove compat code for kernels below 2.6.22

Some code already uses ip_hdr() functions which did not exist in
2.6.21 and I do not feel like adding more compat code.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
This commit is contained in:
Jan Engelhardt
2008-02-21 13:35:19 +01:00
parent 75e88a7321
commit ec9663f680
3 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ Prerequirements
* xtables(-devel) 1.5.0 * xtables(-devel) 1.5.0
* kernel-source >= 2.6.19 with prepared output directory * kernel-source >= 2.6.22 with prepared output directory
Selecting extensions Selecting extensions

View File

@@ -9,8 +9,7 @@
#include <net/route.h> #include <net/route.h>
#include "compat_xtnu.h" #include "compat_xtnu.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && \ #if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 22)
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 22)
static int xtnu_match_run(const struct sk_buff *skb, static int xtnu_match_run(const struct sk_buff *skb,
const struct net_device *in, const struct net_device *out, const struct net_device *in, const struct net_device *out,
const struct xt_match *cm, const void *matchinfo, int offset, const struct xt_match *cm, const void *matchinfo, int offset,
@@ -114,9 +113,7 @@ void xtnu_unregister_matches(struct xtnu_match *nt, unsigned int num)
xtnu_unregister_match(&nt[i]); xtnu_unregister_match(&nt[i]);
} }
EXPORT_SYMBOL_GPL(xtnu_unregister_matches); EXPORT_SYMBOL_GPL(xtnu_unregister_matches);
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 22)
static int xtnu_target_check(const char *table, const void *entry, static int xtnu_target_check(const char *table, const void *entry,
const struct xt_target *ct, void *targinfo, unsigned int hook_mask) const struct xt_target *ct, void *targinfo, unsigned int hook_mask)
{ {
@@ -144,8 +141,7 @@ static bool xtnu_target_check(const char *table, const void *entry,
} }
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && \ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
static unsigned int xtnu_target_run(struct sk_buff **pskb, static unsigned int xtnu_target_run(struct sk_buff **pskb,
const struct net_device *in, const struct net_device *out, const struct net_device *in, const struct net_device *out,
unsigned int hooknum, const struct xt_target *ct, const void *targinfo) unsigned int hooknum, const struct xt_target *ct, const void *targinfo)

View File

@@ -3,7 +3,11 @@
#include <linux/version.h> #include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
# warning Kernels below 2.6.22 not supported anymore
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 24)
# define NF_INET_PRE_ROUTING NF_IP_PRE_ROUTING # define NF_INET_PRE_ROUTING NF_IP_PRE_ROUTING
# define NF_INET_LOCAL_IN NF_IP_LOCAL_IN # define NF_INET_LOCAL_IN NF_IP_LOCAL_IN
# define NF_INET_FORWARD NF_IP_FORWARD # define NF_INET_FORWARD NF_IP_FORWARD
@@ -14,7 +18,7 @@
# include "compat_nfinetaddr.h" # include "compat_nfinetaddr.h"
#endif #endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 22) #if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 22)
# define xt_match xtnu_match # define xt_match xtnu_match
# define xt_register_match xtnu_register_match # define xt_register_match xtnu_register_match
# define xt_unregister_match xtnu_unregister_match # define xt_unregister_match xtnu_unregister_match