Support for Linux 2.6.17

This commit is contained in:
Jan Engelhardt
2008-09-22 13:40:25 -04:00
parent 9c43965a86
commit f3f0741469
6 changed files with 22 additions and 9 deletions

View File

@@ -12,13 +12,9 @@ in combination with the kernel's Kbuild system.
Prerequirements
===============
* a recent iptables snapshot
- from the "xtables" git repository at dev.medozas.de
(minimum as per git-describe: v1.4.0-77)
- or the subversion repository at netfilter.org (minimum: r7502)
- or the xtables-combined tarball that is currently distributed
* iptables 1.4.1
* kernel-source >= 2.6.18.5 with prepared build/output directory
* kernel-source >= 2.6.17 with prepared build/output directory
- CONFIG_NF_CONNTRACK or CONFIG_IP_NF_CONNTRACK
- CONFIG_NF_CONNTRACK_MARK or CONFIG_IP_NF_CONNTRACK_MARK
enabled =y or as module (=m)

View File

@@ -4,6 +4,7 @@
*.ko
*.mod.c
Module.symvers
Modules.symvers
modules.order
/*.so

View File

@@ -408,4 +408,12 @@ void xtnu_csum_replace2(__sum16 *sum, __be16 from, __be16 to)
EXPORT_SYMBOL_GPL(xtnu_csum_replace2);
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)
int xtnu_skb_linearize(struct sk_buff *skb)
{
return skb_linearize(skb, GFP_ATOMIC);
}
EXPORT_SYMBOL_GPL(xtnu_skb_linearize);
#endif
MODULE_LICENSE("GPL");

View File

@@ -5,8 +5,8 @@
#include "compat_skbuff.h"
#include "compat_xtnu.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
# warning Kernels below 2.6.18.5 not supported.
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17)
# warning Kernels below 2.6.17 not supported.
#endif
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
@@ -26,6 +26,11 @@
# warning You need either CONFIG_NF_CONNTRACK or CONFIG_IP_NF_CONNTRACK.
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)
# define skb_init_secmark(skb)
# define skb_linearize xtnu_skb_linearize
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
# define neigh_hh_output xtnu_neigh_hh_output
# define IPPROTO_UDPLITE 136

View File

@@ -83,5 +83,6 @@ extern struct xt_match *xtnu_request_find_match(unsigned int,
const char *, uint8_t);
extern int xtnu_neigh_hh_output(struct hh_cache *, struct sk_buff *);
extern void xtnu_csum_replace2(__u16 __bitwise *, __be16, __be16);
extern int xtnu_skb_linearize(struct sk_buff *);
#endif /* _COMPAT_XTNU_H */

View File

@@ -52,7 +52,7 @@
static void tarpit_tcp(struct sk_buff *oldskb, unsigned int hook)
{
struct tcphdr _otcph, *oth, *tcph;
unsigned int addr_type;
unsigned int addr_type = RTN_UNSPEC;
struct sk_buff *nskb;
struct iphdr *niph;
u_int16_t tmp;
@@ -96,9 +96,11 @@ static void tarpit_tcp(struct sk_buff *oldskb, unsigned int hook)
skb_nfmark(nskb) = 0;
skb_init_secmark(nskb);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
skb_shinfo(nskb)->gso_size = 0;
skb_shinfo(nskb)->gso_segs = 0;
skb_shinfo(nskb)->gso_type = 0;
#endif
tcph = (struct tcphdr *)(skb_network_header(nskb) + ip_hdrlen(nskb));