Add a compat wrapper to make modules work with older Linux.

The extension modules use the API of a fairly recent kernel, if not
even the networking git tree. To make it work with older Linux
kernels, an API wrapper is added. Should compile against
running-kernels Linux 2.6.19..current (tested: 2.6.22..current).

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
This commit is contained in:
Jan Engelhardt
2008-01-29 15:40:57 +01:00
parent 7a981b17b5
commit 47b700b0f5
8 changed files with 343 additions and 7 deletions

View File

@@ -17,11 +17,6 @@
#include <net/ip.h>
#include <net/route.h>
#include <linux/netfilter/x_tables.h>
#ifdef CONFIG_NETFILTER_XT_TARGET_TEE
# include <linux/netfilter/xt_TEE.h>
#else
# include "xt_TEE.h"
#endif
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
# define WITH_CONNTRACK 1
@@ -29,6 +24,9 @@
static struct nf_conn tee_track;
#endif
#include "compat_xtables.h"
#include "xt_TEE.h"
static const union nf_inet_addr zero_address;
/*
@@ -101,7 +99,8 @@ static void tee_ip_direct_send(struct sk_buff *skb)
unsigned int hh_len = LL_RESERVED_SPACE(dev);
/* Be paranoid, rather than too clever. */
if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops != NULL)) {
if (unlikely(skb_headroom(skb) < hh_len)) {
/* if (dev->header_ops != NULL) */
struct sk_buff *skb2;
skb2 = skb_realloc_headroom(skb, LL_RESERVED_SPACE(dev));