Compare commits

..

7 Commits
v1.40 ... v1.41

Author SHA1 Message Date
Jan Engelhardt
aee5aedc63 Xtables-addons 1.41 2012-01-04 21:45:45 +01:00
Jan Engelhardt
54d784ffdf build: stash away build tools and update .gitignore 2012-01-04 21:45:45 +01:00
Jan Engelhardt
076610e3af build: additional compilation fixes for Linux 3.2/3.3 2012-01-04 21:45:43 +01:00
Jan Engelhardt
7a1ad32d1a doc: document --without-kbuild
References: http://comments.gmane.org/gmane.comp.security.firewalls.netfilter.general/42337
2011-12-31 03:06:58 +01:00
Jan Engelhardt
40094379dd doc: update README/INSTALL with recent changes 2011-12-31 03:05:25 +01:00
Jan Engelhardt
ce37dd6984 build: deactivate build of ipset-genl by default 2011-12-31 02:17:30 +01:00
Jan Engelhardt
31fdd86247 build: support for Linux 3.2 2011-12-31 02:15:45 +01:00
17 changed files with 72 additions and 34 deletions

12
.gitignore vendored
View File

@@ -2,9 +2,9 @@
*.lo *.lo
*.loT *.loT
*.o *.o
.deps .deps/
.dirstamp .dirstamp
.libs .libs/
Makefile Makefile
Makefile.in Makefile.in
@@ -17,14 +17,10 @@ Makefile.in
/targets.man /targets.man
/aclocal.m4 /aclocal.m4
/autom4te*.cache /autom4te.cache/
/compile /build-aux/
/config.* /config.*
/configure /configure
/depcomp
/install-sh
/libtool /libtool
/ltmain.sh
/missing
/stamp-h1 /stamp-h1
/xtables-addons.8 /xtables-addons.8

10
INSTALL
View File

@@ -22,14 +22,12 @@ Supported configurations for this release
- CONFIG_CONNECTOR y/m if you wish to receive userspace - CONFIG_CONNECTOR y/m if you wish to receive userspace
notifications from pknock through netlink/connector notifications from pknock through netlink/connector
Compilation of ipset-genl-6.x is enabled by default. This additionally Compilation of ipset-genl-6.x is disabled by default. It has
requires additional requirements.
* libmnl * libmnl
* Linux kernel >= 2.6.35 * Linux kernel >= 2.6.35
so if you do not have these, turn it off in mconfig before compilation.
Selecting extensions Selecting extensions
==================== ====================
@@ -43,6 +41,10 @@ Configuring and compiling
./configure [options] ./configure [options]
--without-kbuild
Deactivate building kernel modules, and just do userspace parts.
--with-kbuild= --with-kbuild=
Specifies the path to the kernel build output directory. We need Specifies the path to the kernel build output directory. We need

3
README
View File

@@ -18,8 +18,7 @@ simplified, and sped up.
Included in this package Included in this package
======================== ========================
- ipset 4.5 - ipset 6.10-genl
- ipset 6.7-genl
- xt_ACCOUNT 1.16, libxt_ACCOUNT 1.3 - xt_ACCOUNT 1.16, libxt_ACCOUNT 1.3

View File

@@ -1,4 +1,5 @@
AC_INIT([xtables-addons], [1.40]) AC_INIT([xtables-addons], [1.41])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_PROG_INSTALL AC_PROG_INSTALL
@@ -10,7 +11,9 @@ AC_PROG_LIBTOOL
AC_ARG_WITH([kbuild], AC_ARG_WITH([kbuild],
AS_HELP_STRING([--with-kbuild=PATH], 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="$withval"],
[kbuilddir="/lib/modules/$(uname -r)/build"]) [kbuilddir="/lib/modules/$(uname -r)/build"])
# #
@@ -60,7 +63,7 @@ if test -n "$kbuilddir"; then
echo "WARNING: Version detection did not succeed. Continue at own luck."; echo "WARNING: Version detection did not succeed. Continue at own luck.";
else else
echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir"; 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. :-)"; echo "WARNING: You are trying a newer kernel. Results may vary. :-)";
elif test "$kmajor" -eq 3; then elif test "$kmajor" -eq 3; then
:; :;

View File

@@ -3,6 +3,16 @@ HEAD
==== ====
v1.41 (2012-01-04)
==================
Changes:
- Deactivate build of ipset-genl by default.
I think the original ipset package can now take over, given there are
a handful of kernels (2.6.39 onwards) that do not need patching.
Enhancements:
- Support for Linux 3.2
v1.40 (2011-11-30) v1.40 (2011-11-30)
================== ==================
Fixes: Fixes:

View File

@@ -1,6 +1,6 @@
.*.cmd .*.cmd
.*.d .*.d
.tmp_versions .tmp_versions/
*.ko *.ko
*.mod.c *.mod.c
Module.markers Module.markers

View File

@@ -8,7 +8,9 @@
*/ */
#include <linux/ip.h> #include <linux/ip.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/version.h> #include <linux/version.h>
@@ -17,6 +19,9 @@
#include <linux/netfilter_arp.h> #include <linux/netfilter_arp.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/route.h> #include <net/route.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
# include <linux/export.h>
#endif
#include "compat_skbuff.h" #include "compat_skbuff.h"
#include "compat_xtnu.h" #include "compat_xtnu.h"

View File

@@ -92,6 +92,12 @@
# define rt_dst(rt) (&(rt)->u.dst) # define rt_dst(rt) (&(rt)->u.dst)
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 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) #if !defined(NIP6) && !defined(NIP6_FMT)
# define NIP6(addr) \ # define NIP6(addr) \
ntohs((addr).s6_addr16[0]), \ ntohs((addr).s6_addr16[0]), \

View File

@@ -12,6 +12,7 @@
#include <linux/icmp.h> #include <linux/icmp.h>
#include <linux/icmpv6.h> #include <linux/icmpv6.h>
#include <linux/sctp.h> #include <linux/sctp.h>
#include <linux/version.h>
#include <linux/netfilter_ipv6/ip6_tables.h> #include <linux/netfilter_ipv6/ip6_tables.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/ipv6.h> #include <net/ipv6.h>
@@ -115,9 +116,14 @@ ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
{ {
int protoff; int protoff;
u8 nexthdr; u8 nexthdr;
__be16 frag_off;
nexthdr = ipv6_hdr(skb)->nexthdr; nexthdr = ipv6_hdr(skb)->nexthdr;
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr); 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) if (protoff < 0)
return false; return false;

View File

@@ -241,7 +241,7 @@ hash_ip6_data_isnull(const struct hash_ip6_elem *elem)
static inline void static inline void
hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src) 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 static inline void

View File

@@ -267,7 +267,7 @@ static inline void
hash_net6_data_copy(struct hash_net6_elem *dst, hash_net6_data_copy(struct hash_net6_elem *dst,
const struct hash_net6_elem *src) 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; dst->cidr = src->cidr;
} }

View File

@@ -31,8 +31,13 @@
#include <net/net_namespace.h> #include <net/net_namespace.h>
#include <net/netns/generic.h> #include <net/netns/generic.h>
#endif #endif
#include "xt_DNETMAP.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
# include <net/netfilter/nf_nat.h>
#else
# include <linux/netfilter/nf_nat.h>
#endif
#include "compat_xtables.h" #include "compat_xtables.h"
#include "xt_DNETMAP.h"
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Marek Kierdelewicz <marek@koba.pl>"); MODULE_AUTHOR("Marek Kierdelewicz <marek@koba.pl>");
@@ -77,7 +82,7 @@ struct dnetmap_entry {
}; };
struct dnetmap_prefix { struct dnetmap_prefix {
struct nf_nat_multi_range_compat prefix; struct nf_nat_ipv4_multi_range_compat prefix;
char prefix_str[16]; char prefix_str[16];
struct list_head list; struct list_head list;
unsigned int refcnt; unsigned int refcnt;
@@ -154,7 +159,7 @@ dnetmap_entry_rlookup(struct dnetmap_net *dnetmap_net, const __be32 addr)
static struct dnetmap_prefix * static struct dnetmap_prefix *
dnetmap_prefix_lookup(struct dnetmap_net *dnetmap_net, 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; struct dnetmap_prefix *p;
@@ -194,7 +199,7 @@ static int dnetmap_tg_check(const struct xt_tgchk_param *par)
{ {
struct dnetmap_net *dnetmap_net = dnetmap_pernet(par->net); struct dnetmap_net *dnetmap_net = dnetmap_pernet(par->net);
const struct xt_DNETMAP_tginfo *tginfo = par->targinfo; 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_prefix *p;
struct dnetmap_entry *e; struct dnetmap_entry *e;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
@@ -213,7 +218,7 @@ static int dnetmap_tg_check(const struct xt_tgchk_param *par)
return ret; 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"); pr_debug("DNETMAP:check: bad MAP_IPS.\n");
return -EINVAL; return -EINVAL;
} }
@@ -316,8 +321,8 @@ dnetmap_tg(struct sk_buff **pskb, const struct xt_action_param *par)
enum ip_conntrack_info ctinfo; enum ip_conntrack_info ctinfo;
__be32 prenat_ip, postnat_ip, prenat_ip_prev; __be32 prenat_ip, postnat_ip, prenat_ip_prev;
const struct xt_DNETMAP_tginfo *tginfo = par->targinfo; 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 nf_nat_range newrange; struct nf_nat_ipv4_range newrange;
struct dnetmap_entry *e; struct dnetmap_entry *e;
struct dnetmap_prefix *p; struct dnetmap_prefix *p;
__s32 jttl; __s32 jttl;
@@ -354,8 +359,8 @@ dnetmap_tg(struct sk_buff **pskb, const struct xt_action_param *par)
spin_unlock_bh(&dnetmap_lock); spin_unlock_bh(&dnetmap_lock);
newrange = ((struct nf_nat_range) { newrange = ((struct nf_nat_ipv4_range) {
mr->range[0].flags | IP_NAT_RANGE_MAP_IPS, mr->range[0].flags | NF_NAT_RANGE_MAP_IPS,
e->prenat_addr, e->prenat_addr, e->prenat_addr, e->prenat_addr,
mr->range[0].min, mr->range[0].max}); mr->range[0].min, mr->range[0].max});
@@ -440,8 +445,8 @@ bind_new_prefix:
spin_unlock_bh(&dnetmap_lock); spin_unlock_bh(&dnetmap_lock);
newrange = ((struct nf_nat_range) { newrange = ((struct nf_nat_ipv4_range) {
mr->range[0].flags | IP_NAT_RANGE_MAP_IPS, mr->range[0].flags | NF_NAT_RANGE_MAP_IPS,
postnat_ip, postnat_ip, postnat_ip, postnat_ip,
mr->range[0].min, mr->range[0].max}); mr->range[0].min, mr->range[0].max});
@@ -459,7 +464,7 @@ static void dnetmap_tg_destroy(const struct xt_tgdtor_param *par)
{ {
struct dnetmap_net *dnetmap_net = dnetmap_pernet(par->net); struct dnetmap_net *dnetmap_net = dnetmap_pernet(par->net);
const struct xt_DNETMAP_tginfo *tginfo = par->targinfo; 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_prefix *p;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
char str[25]; char str[25];

View File

@@ -8,7 +8,11 @@ enum {
}; };
struct xt_DNETMAP_tginfo { struct xt_DNETMAP_tginfo {
#ifdef __KERNEL__
struct nf_nat_ipv4_multi_range_compat prefix;
#else
struct nf_nat_multi_range_compat prefix; struct nf_nat_multi_range_compat prefix;
#endif
__u8 flags; __u8 flags;
__s16 ttl; __s16 ttl;
}; };

View File

@@ -3,6 +3,7 @@
* written by Jan Engelhardt <jengelh [at] medozas de>, 2008 - 2009 * written by Jan Engelhardt <jengelh [at] medozas de>, 2008 - 2009
* placed in the Public Domain * placed in the Public Domain
*/ */
#include <linux/module.h>
#include <linux/netfilter.h> #include <linux/netfilter.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include "compat_xtables.h" #include "compat_xtables.h"

View File

@@ -12,6 +12,7 @@
* version 2, as published by the Free Software Foundation. * version 2, as published by the Free Software Foundation.
*/ */
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>

View File

@@ -20,7 +20,7 @@ build_geoip=m
build_gradm=m build_gradm=m
build_iface=m build_iface=m
build_ipp2p=m build_ipp2p=m
build_ipset6=m build_ipset6=
build_ipv4options=m build_ipv4options=m
build_length2=m build_length2=m
build_lscan=m build_lscan=m

View File

@@ -1,4 +1,4 @@
.TH xtables-addons 8 "v1.40 (2011-11-30)" "" "v1.40 (2011-11-30)" .TH xtables-addons 8 "v1.41 (2012-01-04)" "" "v1.41 (2012-01-04)"
.SH Name .SH Name
Xtables-addons \(em additional extensions for iptables, ip6tables, etc. Xtables-addons \(em additional extensions for iptables, ip6tables, etc.
.SH Targets .SH Targets