diff --git a/configure.ac b/configure.ac index f2c363b..969ee0d 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,9 @@ AC_PROG_LIBTOOL AC_ARG_WITH([kbuild], AS_HELP_STRING([--with-kbuild=PATH], - [Path to kernel build directory [[/lib/modules/CURRENT/build]]]), + [Path to kernel build directory [[/lib/modules/CURRENT/build]]]) + AS_HELP_STRING([--without-kbuild], + [Build only userspace tools]), [kbuilddir="$withval"], [kbuilddir="/lib/modules/$(uname -r)/build"]) # @@ -60,7 +62,7 @@ if test -n "$kbuilddir"; then echo "WARNING: Version detection did not succeed. Continue at own luck."; else echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir"; - if test "$kmajor" -gt 3 -o "$kmajor" -eq 3 -a "$kminor" -gt 1; then + if test "$kmajor" -gt 3 -o "$kmajor" -eq 3 -a "$kminor" -gt 2; then echo "WARNING: You are trying a newer kernel. Results may vary. :-)"; elif test "$kmajor" -eq 3; then :; diff --git a/doc/changelog.txt b/doc/changelog.txt index 77dbe6f..638232a 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,6 +1,8 @@ HEAD ==== +Enhancements: +- Support for Linux 3.2 v1.40 (2011-11-30) diff --git a/extensions/compat_xtables.h b/extensions/compat_xtables.h index db36980..4cfd3e6 100644 --- a/extensions/compat_xtables.h +++ b/extensions/compat_xtables.h @@ -92,6 +92,12 @@ # define rt_dst(rt) (&(rt)->u.dst) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) +# define nf_nat_ipv4_multi_range_compat nf_nat_multi_range_compat +# define nf_nat_ipv4_range nf_nat_range +# define NF_NAT_RANGE_MAP_IPS IP_NAT_RANGE_MAP_IPS +#endif + #if !defined(NIP6) && !defined(NIP6_FMT) # define NIP6(addr) \ ntohs((addr).s6_addr16[0]), \ diff --git a/extensions/ipset-6/ip_set_getport.c b/extensions/ipset-6/ip_set_getport.c index 9824d00..ae80896 100644 --- a/extensions/ipset-6/ip_set_getport.c +++ b/extensions/ipset-6/ip_set_getport.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -115,9 +116,14 @@ ip_set_get_ip6_port(const struct sk_buff *skb, bool src, { int protoff; u8 nexthdr; + __be16 frag_off; nexthdr = ipv6_hdr(skb)->nexthdr; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr); +#else + protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr, &frag_off); +#endif if (protoff < 0) return false; diff --git a/extensions/ipset-6/ip_set_hash_ip.c b/extensions/ipset-6/ip_set_hash_ip.c index c5c1234..91fd50f 100644 --- a/extensions/ipset-6/ip_set_hash_ip.c +++ b/extensions/ipset-6/ip_set_hash_ip.c @@ -241,7 +241,7 @@ hash_ip6_data_isnull(const struct hash_ip6_elem *elem) static inline void hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src) { - ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); + dst->ip.in6 = src->ip.in6; } static inline void diff --git a/extensions/ipset-6/ip_set_hash_net.c b/extensions/ipset-6/ip_set_hash_net.c index 4e6505a..479bee8 100644 --- a/extensions/ipset-6/ip_set_hash_net.c +++ b/extensions/ipset-6/ip_set_hash_net.c @@ -267,7 +267,7 @@ static inline void hash_net6_data_copy(struct hash_net6_elem *dst, const struct hash_net6_elem *src) { - ipv6_addr_copy(&dst->ip.in6, &src->ip.in6); + dst->ip.in6 = src->ip.in6; dst->cidr = src->cidr; } diff --git a/extensions/xt_DNETMAP.c b/extensions/xt_DNETMAP.c index cc6bb92..7ca16a3 100644 --- a/extensions/xt_DNETMAP.c +++ b/extensions/xt_DNETMAP.c @@ -77,7 +77,7 @@ struct dnetmap_entry { }; struct dnetmap_prefix { - struct nf_nat_multi_range_compat prefix; + struct nf_nat_ipv4_multi_range_compat prefix; char prefix_str[16]; struct list_head list; unsigned int refcnt; @@ -154,7 +154,7 @@ dnetmap_entry_rlookup(struct dnetmap_net *dnetmap_net, const __be32 addr) static struct dnetmap_prefix * dnetmap_prefix_lookup(struct dnetmap_net *dnetmap_net, - const struct nf_nat_multi_range_compat *mr) + const struct nf_nat_ipv4_multi_range_compat *mr) { struct dnetmap_prefix *p; @@ -194,7 +194,7 @@ static int dnetmap_tg_check(const struct xt_tgchk_param *par) { struct dnetmap_net *dnetmap_net = dnetmap_pernet(par->net); const struct xt_DNETMAP_tginfo *tginfo = par->targinfo; - const struct nf_nat_multi_range_compat *mr = &tginfo->prefix; + const struct nf_nat_ipv4_multi_range_compat *mr = &tginfo->prefix; struct dnetmap_prefix *p; struct dnetmap_entry *e; #ifdef CONFIG_PROC_FS @@ -213,7 +213,7 @@ static int dnetmap_tg_check(const struct xt_tgchk_param *par) return ret; } - if (!(mr->range[0].flags & IP_NAT_RANGE_MAP_IPS)) { + if (!(mr->range[0].flags & NF_NAT_RANGE_MAP_IPS)) { pr_debug("DNETMAP:check: bad MAP_IPS.\n"); return -EINVAL; } @@ -316,8 +316,8 @@ dnetmap_tg(struct sk_buff **pskb, const struct xt_action_param *par) enum ip_conntrack_info ctinfo; __be32 prenat_ip, postnat_ip, prenat_ip_prev; const struct xt_DNETMAP_tginfo *tginfo = par->targinfo; - const struct nf_nat_multi_range_compat *mr = &tginfo->prefix; - struct nf_nat_range newrange; + const struct nf_nat_ipv4_multi_range_compat *mr = &tginfo->prefix; + struct nf_nat_ipv4_range newrange; struct dnetmap_entry *e; struct dnetmap_prefix *p; __s32 jttl; @@ -354,8 +354,8 @@ dnetmap_tg(struct sk_buff **pskb, const struct xt_action_param *par) spin_unlock_bh(&dnetmap_lock); - newrange = ((struct nf_nat_range) { - mr->range[0].flags | IP_NAT_RANGE_MAP_IPS, + newrange = ((struct nf_nat_ipv4_range) { + mr->range[0].flags | NF_NAT_RANGE_MAP_IPS, e->prenat_addr, e->prenat_addr, mr->range[0].min, mr->range[0].max}); @@ -440,8 +440,8 @@ bind_new_prefix: spin_unlock_bh(&dnetmap_lock); - newrange = ((struct nf_nat_range) { - mr->range[0].flags | IP_NAT_RANGE_MAP_IPS, + newrange = ((struct nf_nat_ipv4_range) { + mr->range[0].flags | NF_NAT_RANGE_MAP_IPS, postnat_ip, postnat_ip, mr->range[0].min, mr->range[0].max}); @@ -459,7 +459,7 @@ static void dnetmap_tg_destroy(const struct xt_tgdtor_param *par) { struct dnetmap_net *dnetmap_net = dnetmap_pernet(par->net); const struct xt_DNETMAP_tginfo *tginfo = par->targinfo; - const struct nf_nat_multi_range_compat *mr = &tginfo->prefix; + const struct nf_nat_ipv4_multi_range_compat *mr = &tginfo->prefix; struct dnetmap_prefix *p; #ifdef CONFIG_PROC_FS char str[25]; diff --git a/extensions/xt_DNETMAP.h b/extensions/xt_DNETMAP.h index 2a71cb9..274b083 100644 --- a/extensions/xt_DNETMAP.h +++ b/extensions/xt_DNETMAP.h @@ -8,7 +8,7 @@ enum { }; struct xt_DNETMAP_tginfo { - struct nf_nat_multi_range_compat prefix; + struct nf_nat_ipv4_multi_range_compat prefix; __u8 flags; __s16 ttl; };