]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
15 years agolibiptc: fix wrong maptype of base chain counters on restore
Jan Engelhardt [Mon, 26 Oct 2009 17:43:54 +0000 (18:43 +0100)] 
libiptc: fix wrong maptype of base chain counters on restore

When a ruleset that does not reset any chain policies/counters, such as

*filter
COMMIT

is sourced by iptables-restore, the previous policy and counters
(i.e. the ones read from the kernel) are reused. The counter skew
offsetting is wrong however, causing the read value to be readded to
the kernel value. This manifests itself in practice by the counter
value almost doubling everytime iptables-restore is called.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agobuild: restore --disable-ipv6 functionality on system w/o v6 headers
Olaf Rempel [Sun, 20 Sep 2009 11:24:11 +0000 (13:24 +0200)] 
build: restore --disable-ipv6 functionality on system w/o v6 headers

Commit 332e4acc (iptables: accept multiple IP address specifications
for -s, d) broke the --disable-ipv6 configure option.

> ./.libs/libxtables.so: undefined reference to `in6addr_any'

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoiprange: warn on reverse range (log)
Jan Engelhardt [Thu, 29 Oct 2009 18:03:38 +0000 (19:03 +0100)] 
iprange: warn on reverse range (log)

Reverse ranges like B-A cause packets to be generally never matched,
as an address S does not match >=B && <=A (except for the border case
where S=A=B).

The kernel module itself does not check for reverse ranges, and it
seems nicer to check that in userspace anyway.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoiprange: do accept non-ranges for xt_iprange v1 (log)
Jan Engelhardt [Sun, 25 Oct 2009 10:34:55 +0000 (11:34 +0100)] 
iprange: do accept non-ranges for xt_iprange v1 (log)

Details for commit v1.4.5-11-ga10a12a:

"When upgraded to new lenny kernel from 2.6.24 from etch'n'half
iprange now does not allow to use single ip-address as its argument:

# iptables -A FORWARD -m iprange --src-range 192.168.0.0"

References: http://bugs.debian.org/547139

What we have here is that the user is now using iprange v1 from
previously v0.
Add recognition for single addresses to v1.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoiprange: roll address parsing into a loop
Jan Engelhardt [Fri, 18 Sep 2009 11:07:09 +0000 (13:07 +0200)] 
iprange: roll address parsing into a loop

15 years agoiprange: warn on reverse range
Jan Engelhardt [Fri, 18 Sep 2009 11:01:05 +0000 (13:01 +0200)] 
iprange: warn on reverse range

15 years agoiprange: do accept non-ranges for xt_iprange v1
Jan Engelhardt [Fri, 18 Sep 2009 07:59:26 +0000 (09:59 +0200)] 
iprange: do accept non-ranges for xt_iprange v1

[fill in details]

15 years agolibiptc: avoid strict-aliasing warnings
Jan Engelhardt [Fri, 23 Oct 2009 21:35:49 +0000 (23:35 +0200)] 
libiptc: avoid strict-aliasing warnings

In file included from libiptc/libip4tc.c:117:0:
libiptc/libiptc.c: In function ‘__iptcc_p_del_policy’:
libiptc/libiptc.c:826:4: warning: dereferencing type-punned pointer will break
strict-aliasing rules
libiptc/libiptc.c: In function ‘iptc_get_target’:
libiptc/libiptc.c:1650:4: warning: dereferencing type-punned pointer will break
strict-aliasing rules
libiptc/libip4tc.c: In function ‘dump_entry’:
libiptc/libip4tc.c:157:3: warning: dereferencing type-punned pointer will break
strict-aliasing rules
  CC     libiptc/libip6tc.lo
In file included from libiptc/libip6tc.c:112:0:
libiptc/libiptc.c: In function ‘__iptcc_p_del_policy’:
libiptc/libiptc.c:826:4: warning: dereferencing type-punned pointer will break
strict-aliasing rules
libiptc/libiptc.c: In function ‘ip6tc_get_target’:
libiptc/libiptc.c:1650:4: warning: dereferencing type-punned pointer will break
strict-aliasing rules
libiptc/libip6tc.c: In function ‘dump_entry’:
libiptc/libip6tc.c:188:3: warning: dereferencing type-punned pointer will break
strict-aliasing rules

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibiptc: remove unused functions
Jan Engelhardt [Fri, 23 Oct 2009 21:40:02 +0000 (23:40 +0200)] 
libiptc: remove unused functions

Fix the two warnings in libiptc.c:

  CC     libiptc/libip4tc.lo
libiptc/libiptc.c:1570:1: warning: ‘iptc_num_rules’ defined but not used
libiptc/libiptc.c:1586:1: warning: ‘iptc_get_rule’ defined but not used
  CC     libiptc/libip6tc.lo
libiptc/libiptc.c:1570:1: warning: ‘ip6tc_num_rules’ defined but not used
libiptc/libiptc.c:1586:1: warning: ‘ip6tc_get_rule’ defined but not used

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agorealm: remove static initializations
Jan Engelhardt [Fri, 23 Oct 2009 23:30:28 +0000 (01:30 +0200)] 
realm: remove static initializations

Save a little disk space, they are initialized to zero anyway.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: update TCPMSS manpage with Linux 2.6.25 changes
Tim Small [Fri, 16 Oct 2009 19:00:04 +0000 (20:00 +0100)] 
doc: update TCPMSS manpage with Linux 2.6.25 changes

References: http://bugs.debian.org/551272

[j.eng: modified --set-mss option description to be understandable]

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoSupport for nommu arches
Jan Engelhardt [Sun, 11 Oct 2009 07:56:18 +0000 (03:56 -0400)] 
Support for nommu arches

Linux systems that lack a MMU cannot call fork(). Fortunately, the
only place in iptables that uses fork() follows it by an exec(), so
we can easily convert the code to vfork().

References: http://bugzilla.netfilter.org/show_bug.cgi?id=614

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: fix typo in length manpage
sobtwmxt [Wed, 21 Oct 2009 10:05:01 +0000 (10:05 +0000)] 
doc: fix typo in length manpage

References: http://bugs.debian.org/551867
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: mention maximum mark size in manpages
Jan Engelhardt [Mon, 5 Oct 2009 11:24:02 +0000 (13:24 +0200)] 
doc: mention maximum mark size in manpages

15 years agoMerge branch 'zero' of git://dev.medozas.de/iptables
Patrick McHardy [Mon, 14 Sep 2009 18:06:31 +0000 (20:06 +0200)] 
Merge branch 'zero' of git://dev.medozas.de/iptables

15 years agoBump version number to 1.4.5 v1.4.5
Patrick McHardy [Mon, 14 Sep 2009 16:36:55 +0000 (18:36 +0200)] 
Bump version number to 1.4.5

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoman: fix incorrect plural in libipt_set.man
Patrick McHardy [Mon, 24 Aug 2009 12:18:27 +0000 (14:18 +0200)] 
man: fix incorrect plural in libipt_set.man

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoiptables: manpage updates for augmented -Z syntax
Jan Engelhardt [Wed, 19 Aug 2009 20:36:03 +0000 (22:36 +0200)] 
iptables: manpage updates for augmented -Z syntax

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoiptables: expose option to zero packet/byte counters for a specific rule
Mohit Mehta [Wed, 19 Aug 2009 17:56:33 +0000 (10:56 -0700)] 
iptables: expose option to zero packet/byte counters for a specific rule

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agomanpages: more fixes to minuses, hyphens, dashes
Jan Engelhardt [Thu, 20 Aug 2009 15:15:22 +0000 (17:15 +0200)] 
manpages: more fixes to minuses, hyphens, dashes

Debian still carries patches patches to the iptables nroff code touching
ASCII minuses, so I thought, what's it this time.

Eventually, this patch tries to straighten things once more, per
http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#Hyphens and
http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#Dashes .

Titles will get the em dash; all typed commands or parameters with a
hyphen get a minus (so that man(1) hyperlinking and copy-pasting does
work), but other mentions get the hyphen.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agomanpage: fix lintian warnings
Laurence J. Lane [Thu, 20 Aug 2009 15:14:25 +0000 (17:14 +0200)] 
manpage: fix lintian warnings

Description: extraneous slash caused this lintian warning:
  W: iptables: manpage-has-errors-from-man usr/share/man/man8/iptables.8.gz
     220: cannot use newline as a starting delimiter
  W: iptables: manpage-has-errors-from-man usr/share/man/man8/ip6tables.8.gz
     1823: warning: `precedence'' not defined

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoipt_set: fix a typo in the manpage
Trent W. Buck [Thu, 20 Aug 2009 15:13:27 +0000 (17:13 +0200)] 
ipt_set: fix a typo in the manpage

References: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539101
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agolibxt_NFQUEUE: add new v1 version with queue-balance option
Florian Westphal [Thu, 20 Aug 2009 14:39:05 +0000 (16:39 +0200)] 
libxt_NFQUEUE: add new v1 version with queue-balance option

New version that adds support for specifying a queue range instead
of a single queue id.
The kernel will distribute flows across the given queue range.

This is useful for multicore systems, simply start multiple instances
of the userspace program on queues x, x+1, .. x+n and use
"--queue-balance x:x+n".
Packets belonging to the same connection are put into the same queue.

With fixes from Jan Engelhardt.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoMerge branch 'stable'
Jan Engelhardt [Wed, 5 Aug 2009 16:13:11 +0000 (18:13 +0200)] 
Merge branch 'stable'

Conflicts:
extensions/libxt_conntrack.c

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: build only iptables-multi
Jan Engelhardt [Sat, 25 Jul 2009 16:18:36 +0000 (18:18 +0200)] 
build: build only iptables-multi

I see no pressing reason to install all single programs when the
multi binary can do the job. Within the build directory, developers
can run the components by means of, for example,

./ip6tables-multi {main|restore|save} ...

And when make install-ed, symlinks are available.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: combine iptables-multi and iptables-static
Jan Engelhardt [Thu, 23 Jul 2009 15:41:21 +0000 (17:41 +0200)] 
build: combine iptables-multi and iptables-static

Changed the Makefile so that:

1. --enable-shared / --disable-shared control the linkage against
   libdl (and thus the potential to use 3rd party extensions)

2. --enable-static / --disable-static controls whether shipped
   extensions are built-in or provided as modules

iptables-static becomes redundant by this action; iptables-multi now
has the feature.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: fix struct size mismatch
Jan Engelhardt [Thu, 23 Jul 2009 18:21:45 +0000 (20:21 +0200)] 
build: fix struct size mismatch

Mixing code compiled with and without -DNO_SHARED_LIBS is fine as
long as the structs have the same layout. This patch prevents a
potential (currently non-triggerable) "ip6tables: target (null)<123>
is missing a version" error.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agomulti binary: allow subcommand via argv[1]
Jan Engelhardt [Sat, 25 Jul 2009 12:28:07 +0000 (14:28 +0200)] 
multi binary: allow subcommand via argv[1]

libtool does not play well with symlinks when trying to run commands
in the build directory. So provide an alternate way to call
iptables-multi: when argv[0] is not a recognized name, inspect [1]
for an alternate identifer.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: order of dependent libs is sensitive
Jan Engelhardt [Thu, 23 Jul 2009 13:06:16 +0000 (15:06 +0200)] 
build: order of dependent libs is sensitive

libiptc.la must come after its components or `make install` won't get
things right.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoCOMMIT_NOTES: notice to check for soversion bumps
Jan Engelhardt [Thu, 25 Jun 2009 19:33:23 +0000 (21:33 +0200)] 
COMMIT_NOTES: notice to check for soversion bumps

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoxtables: warn of missing version identifier in extensions
Jan Engelhardt [Thu, 25 Jun 2009 19:25:24 +0000 (21:25 +0200)] 
xtables: warn of missing version identifier in extensions

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: collapse data variables to use multi-reg calls
Jan Engelhardt [Thu, 25 Jun 2009 18:12:12 +0000 (20:12 +0200)] 
extensions: collapse data variables to use multi-reg calls

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoxtables: add multi-registration functions
Jan Engelhardt [Thu, 25 Jun 2009 15:13:46 +0000 (17:13 +0200)] 
xtables: add multi-registration functions

Similar to the ones that are present in the kernel.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: remove empty help and parse functions
Jan Engelhardt [Fri, 12 Jun 2009 18:59:34 +0000 (20:59 +0200)] 
extensions: remove empty help and parse functions

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables: allow for help-less extensions
Jan Engelhardt [Fri, 12 Jun 2009 18:48:52 +0000 (20:48 +0200)] 
iptables: allow for help-less extensions

This is for extensions that do not take any options, and which
subsequently do not offer any help text either.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables: allow for parse-less extensions
Jan Engelhardt [Fri, 12 Jun 2009 18:35:42 +0000 (20:35 +0200)] 
iptables: allow for parse-less extensions

This means we can do some code removal in extensions.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: collapse registration structures
Jan Engelhardt [Fri, 12 Jun 2009 18:55:44 +0000 (20:55 +0200)] 
extensions: collapse registration structures

There are no different code paths between IPV4 and IPV6, so
data can be consolidated here.

   text    data     bss     dec     hex filename
 243757   12212    2576  258545   3f1f1 ip6tables-static[before.i586]
 243613    9428    2576  255617   3e681 ip6tables-static[after.i586]
   -144   -2784

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibiptc: split v4 and v6
Jan Engelhardt [Mon, 1 Jun 2009 11:36:30 +0000 (13:36 +0200)] 
libiptc: split v4 and v6

The split can save some diskspace for constrained systems running
which are only running one protocol.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables: accept multiple IP address specifications for -s, -d
Michael Granzow [Thu, 9 Apr 2009 17:24:36 +0000 (18:24 +0100)] 
iptables: accept multiple IP address specifications for -s, -d

libiptc already supports adding and deleting multiple rules with
different addresses, so it only needs to be wired up to the options.

# ip6tables -I INPUT -s 2001:db8::d,2001:db8::e -j DROP

References: http://marc.info/?l=netfilter-devel&m=123929790719202&w=2

Adjustments made: syntax, removal of unneeded variables, manpage
adjustment, soversion bump.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_helper: fix invalid passed option to check_inverse
Jan Engelhardt [Thu, 25 Jun 2009 17:41:28 +0000 (19:41 +0200)] 
libxt_helper: fix invalid passed option to check_inverse

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoxt_conntrack: revision 2 for enlarged state_mask member
Jan Engelhardt [Thu, 25 Jun 2009 16:46:37 +0000 (18:46 +0200)] 
xt_conntrack: revision 2 for enlarged state_mask member

This complements the xt_conntrack revision 2 code added to the kenrel.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoBump version v1.4.4
Patrick McHardy [Tue, 16 Jun 2009 14:37:44 +0000 (16:37 +0200)] 
Bump version

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoMerge branch 'stable' of git://dev.medozas.de/iptables
Patrick McHardy [Thu, 11 Jun 2009 15:56:24 +0000 (17:56 +0200)] 
Merge branch 'stable' of git://dev.medozas.de/iptables

16 years agoUpdated set/SET match and target to support multiple ipset protocols.
Jozsef Kadlecsik [Thu, 11 Jun 2009 10:27:09 +0000 (12:27 +0200)] 
Updated set/SET match and target to support multiple ipset protocols.

By checking the protocol version of the kernel part, the sockopt type
of ipset protocols are all supported. Forward compatibility with the
netlink based protocol is missing.

The --set option of the set match is replaced by --match-set to avoid
clashing with the recent match, but the old option is also kept.

Manpages are updated, references to bindings removed.

16 years agomanpages: markup corrections
Jan Engelhardt [Wed, 10 Jun 2009 18:18:43 +0000 (20:18 +0200)] 
manpages: markup corrections

The manpage of xt_cluster and xt_recent had some unclosed tags.
Backslashes in commands are also not wanted because manpages are a
freeform, automatically-wrapped text.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables: close open file descriptors
Jan Engelhardt [Wed, 10 Jun 2009 11:52:58 +0000 (13:52 +0200)] 
iptables: close open file descriptors

Just for correctness, close some file descriptors that were opened.
(E.g. ip6tables-save reading from procfs files.)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_connlimit: initialize v6_mask
kd6lvw [Sun, 7 Jun 2009 12:23:00 +0000 (14:23 +0200)] 
libxt_connlimit: initialize v6_mask

When converting "--connlimit-mask $bits" to a 128-bit v6 mask, the
code uses a left shift on v6_mask[n]. This requires v6_mask to be
filled with all one-bits beforehand, but this initialization was not
done.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=597
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_tcp: manpage corrections and suggestions
Ian Bruce [Sat, 6 Jun 2009 04:04:24 +0000 (06:04 +0200)] 
libxt_tcp: manpage corrections and suggestions

From: Ian Bruce <ian_bruce@fastmail.net>

The commit corrects some minor errors in the iptables(8) man page,
related to port ranges in the "tcp" module.

Reference: http://bugs.debian.org/531677
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_tcp: fix a manpage syntax typo
Frank Tobin [Thu, 21 May 2009 03:09:00 +0000 (05:09 +0200)] 
libxt_tcp: fix a manpage syntax typo

Reference: http://bugzilla.netfilter.org/show_bug.cgi?id=596
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: remove redundant casts
Jan Engelhardt [Mon, 8 Jun 2009 13:46:52 +0000 (15:46 +0200)] 
extensions: remove redundant casts

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoDNAT/SNAT: add manpage documentation for --persistent flag
Jan Engelhardt [Mon, 8 Jun 2009 13:46:19 +0000 (15:46 +0200)] 
DNAT/SNAT: add manpage documentation for --persistent flag

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoextensions: use NFPROTO_UNSPEC for .family field
Jan Engelhardt [Mon, 1 Jun 2009 09:56:23 +0000 (11:56 +0200)] 
extensions: use NFPROTO_UNSPEC for .family field

This constant would be the designated one for the .family field; it
also, given recent changes, makes grep for NFPROTO_UNSPEC work to
finally recollect all manpages.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: fix manpage collection
Jan Engelhardt [Mon, 1 Jun 2009 09:52:07 +0000 (11:52 +0200)] 
build: fix manpage collection

Florian Westphal points out that v1.4.3.2-9-gc304d77 greps for the
keyword in the wrong file, and that files with NFPROTO_UNSPEC are
skipped.

This patch corrects that part, and makes `make` now output the
manpages it collected.

Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agopolicy: merge ipv6 and ipv4 variant
Jan Engelhardt [Mon, 1 Jun 2009 09:46:12 +0000 (11:46 +0200)] 
policy: merge ipv6 and ipv4 variant

The files duplicate most of their code, and struct ipt_policy_info
being defined to xt_policy_info makes them actually have even more in
common.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agopolicy: use direct xt_policy_info instead of ipt/ip6t
Jan Engelhardt [Sun, 31 May 2009 20:43:12 +0000 (22:43 +0200)] 
policy: use direct xt_policy_info instead of ipt/ip6t

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibip6t_policy: remove redundant functions
Jan Engelhardt [Sun, 31 May 2009 20:34:54 +0000 (22:34 +0200)] 
libip6t_policy: remove redundant functions

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agomanpages: do not include v4-only modules in ip6tables manpage
Jan Engelhardt [Tue, 26 May 2009 11:21:55 +0000 (13:21 +0200)] 
manpages: do not include v4-only modules in ip6tables manpage

References: http://bugs.debian.org/529954
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoaddrtype: fix one manpage type
Jan Engelhardt [Wed, 13 May 2009 15:40:05 +0000 (17:40 +0200)] 
addrtype: fix one manpage type

References: http://bugs.debian.org/528457
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables: replace open-coded sizeof by ARRAY_SIZE
Jan Engelhardt [Thu, 30 Apr 2009 17:32:02 +0000 (19:32 +0200)] 
iptables: replace open-coded sizeof by ARRAY_SIZE

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: add const qualifiers in print/save functions
Jan Engelhardt [Tue, 26 May 2009 11:14:06 +0000 (13:14 +0200)] 
extensions: add const qualifiers in print/save functions

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoxtables: use extern "C"
Jan Engelhardt [Fri, 22 May 2009 09:46:55 +0000 (11:46 +0200)] 
xtables: use extern "C"

This fixes linking errors for 3rd-party C++ code.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoAdd new COMMIT_NOTES document
Jan Engelhardt [Mon, 25 May 2009 14:57:52 +0000 (16:57 +0200)] 
Add new COMMIT_NOTES document

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoxtables: fix segfault if incorrect protocol name is used
Pablo Neira Ayuso [Tue, 12 May 2009 07:51:26 +0000 (09:51 +0200)] 
xtables: fix segfault if incorrect protocol name is used

This patch fixes a segfault that can be triggered if you use an
incorrect protocol, e.g.

# iptables -I PREROUTING -t nat -p lalala --dport 21 -j DNAT --to 192.168.1.2:21
Segmentation fault

With this patch:

# iptables -I PREROUTING -t nat -p lalala --dport 21 -j DNAT --to 192.168.1.2:21
iptables v1.4.3.2: unknown protocol `lala' specified
Try `iptables -h' or 'iptables --help' for more information

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoextensions: add `cluster' match support
Pablo Neira Ayuso [Wed, 6 May 2009 11:01:20 +0000 (13:01 +0200)] 
extensions: add `cluster' match support

This patch adds support for the cluster match to iptables.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoSNAT/DNAT: add support for persistent multi-range NAT mappings
Patrick McHardy [Fri, 17 Apr 2009 16:11:09 +0000 (18:11 +0200)] 
SNAT/DNAT: add support for persistent multi-range NAT mappings

Add support for persistent mappings (2.6.29-rc2+) as replacement for the
removed SAME target.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agobuild: bump version to 1.4.3.2 v1.4.3.2
Pablo Neira Ayuso [Mon, 6 Apr 2009 11:09:17 +0000 (13:09 +0200)] 
build: bump version to 1.4.3.2

This patch bumps iptables version to 1.4.3.2

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agolibxt_conntrack: properly output negation symbol
Jan Engelhardt [Sat, 4 Apr 2009 22:05:30 +0000 (00:05 +0200)] 
libxt_conntrack: properly output negation symbol

Because the wrong flag was checked, the "!" was either wrongly
printed, or not printed at all.
This was broken since v1.4.0-29-ga8ad34c.

Reported-by: Steven Jan Springl <steven@springl.ukfsn.org>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoCLASSIFY: document non-standard interpretation behavior
Jan Engelhardt [Sat, 4 Apr 2009 16:43:15 +0000 (18:43 +0200)] 
CLASSIFY: document non-standard interpretation behavior

Most other extensions use strtoul (by means of xtables_strtoui)
and would abide by the standard convention of hex/octal prefixes
0x/0, and decimal otherwise, but CLASSIFY is an exception.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoMerge branch 'plus'
Jan Engelhardt [Sat, 4 Apr 2009 12:10:49 +0000 (14:10 +0200)] 
Merge branch 'plus'

16 years agoMerge commit 'v1.4.3'
Jan Engelhardt [Sat, 4 Apr 2009 12:03:50 +0000 (14:03 +0200)] 
Merge commit 'v1.4.3'

Connect history to the tag.

16 years agoiptables: print negation extrapositioned
Jan Engelhardt [Sat, 4 Apr 2009 11:28:40 +0000 (13:28 +0200)] 
iptables: print negation extrapositioned

This patch combines the two referenced ones by Peter. I did a quick
extra audit to spot and fix the missing ip6tables parts. (People like
to forget ip6tables it seems.) Extension modules were, to the best of
my knowledge, already audited in v1.4.3-rc1-10-gcea9f71.

Reported-by: Yar Odin <yarodin@gmail.com>
References: http://bugs.gentoo.org/264089
Reported-by: Peter Volkov <pva@gentoo.org>
References: http://marc.info/?l=netfilter-devel&m=123883867907935&w=2
References: http://marc.info/?l=netfilter-devel&m=123883992508943&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: provide IPv6 zero address variable
Jan Engelhardt [Fri, 3 Apr 2009 20:40:35 +0000 (22:40 +0200)] 
libxtables: provide IPv6 zero address variable

µClibc may not provide the in6addr_any variable when IPv6 is
disabled. So just provide it ourselves.

Reference: http://bugzilla.netfilter.org/show_bug.cgi?id=569
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: add configure option to disable ipv4 iptables
Jan Engelhardt [Fri, 3 Apr 2009 20:37:49 +0000 (22:37 +0200)] 
build: add configure option to disable ipv4 iptables

This patch complements the previous one.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: add configure option to disable ip6tables
Jan Engelhardt [Fri, 3 Apr 2009 20:28:34 +0000 (22:28 +0200)] 
build: add configure option to disable ip6tables

This also skips building the IPv6 extensions. It does not #ifdef out
all code however, I think that would make it too ugly.

Inspired-by: http://bugzilla.netfilter.org/show_bug.cgi?id=560
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: do not run ldconfig for DESTDIR installations
Jan Engelhardt [Sun, 29 Mar 2009 23:28:44 +0000 (01:28 +0200)] 
build: do not run ldconfig for DESTDIR installations

Reference: http://bugzilla.netfilter.org/show_bug.cgi?id=560
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: reorder .version member
Jan Engelhardt [Sun, 29 Mar 2009 22:44:46 +0000 (00:44 +0200)] 
libxtables: reorder .version member

When the structure's layout changes, as it did between v1.4.1 and
v1.4.2, trying to compare the version string makes iptables segfault
while it tries to determine whether the module is compatible in the
first place.

By moving the member to a known offset in the struct and keeping it
there, objects (both iptables and 3rd party) compiled from this
commit onwards will avoid the segfault.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables-multi: support "iptables-static" as a callable name
Jan Engelhardt [Tue, 24 Mar 2009 21:35:10 +0000 (22:35 +0100)] 
iptables-multi: support "iptables-static" as a callable name

iptables multi-purpose version: unknown applet name iptables-static

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_tcpmss: fix an inversion while parsing --mss
Jan Engelhardt [Tue, 24 Mar 2009 21:26:25 +0000 (22:26 +0100)] 
libxt_tcpmss: fix an inversion while parsing --mss

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables: refer to dmesg if we hit EINVAL v1.4.3.1
Pablo Neira Ayuso [Tue, 24 Mar 2009 12:08:24 +0000 (13:08 +0100)] 
iptables: refer to dmesg if we hit EINVAL

With this patch, iptables refers to dmesg for further
troubleshooting if we hit EINVAL.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agobuild: bump version to 1.4.3.1
Pablo Neira Ayuso [Tue, 24 Mar 2009 11:54:31 +0000 (12:54 +0100)] 
build: bump version to 1.4.3.1

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agobuild: fix linker issue when LDFLAGS contains --as-needed
Peter Volkov [Tue, 24 Mar 2009 08:09:16 +0000 (11:09 +0300)] 
build: fix linker issue when LDFLAGS contains --as-needed

The link of iptables-save fails on:

$ make LDFLAGS="-Wl,--as-needed"
[...]
extensions/libext4.a(libxt_RATEEST.o): In function `RATEEST_final_check':
extensions/libxt_RATEEST.c:164: undefined reference to `log'

Helpful Reference: http://www.gentoo.org/proj/en/qa/asneeded.xml
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_hashlimit: add missing space for iptables-save output
Jan Engelhardt [Tue, 24 Mar 2009 11:13:53 +0000 (12:13 +0100)] 
libxt_hashlimit: add missing space for iptables-save output

Reference: http://bugzilla.netfilter.org/show_bug.cgi?id=568
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: fix compile error due to incomplete change
Peter Volkov [Tue, 24 Mar 2009 08:09:16 +0000 (11:09 +0300)] 
libxtables: fix compile error due to incomplete change

Commit 2338efd8f799d8373dc196c797bda9690283b698 forgot to update
the constant in one place, and the compile error triggered only
when -DNO_SHARED_LIBS (configure --disable-shared) was in effect.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables-save: minor corrections to the manpage markup
Jan Engelhardt [Thu, 19 Mar 2009 16:14:49 +0000 (17:14 +0100)] 
iptables-save: minor corrections to the manpage markup

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoBump version to 1.4.3 v1.4.3
Patrick McHardy [Mon, 23 Mar 2009 13:39:16 +0000 (14:39 +0100)] 
Bump version to 1.4.3

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: give credits to my self
Jesper Dangaard Brouer [Mon, 23 Mar 2009 13:27:44 +0000 (14:27 +0100)] 
libiptc: give credits to my self

Add notes about my scalability work on the library libiptc.
This should make in more obvious who to complain to.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: fix whitespaces and typos
Jesper Dangaard Brouer [Mon, 23 Mar 2009 13:26:56 +0000 (14:26 +0100)] 
libiptc: fix whitespaces and typos

Cleanup whitespaces while going through the code.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: fix chain rename bug in libiptc
Jesper Dangaard Brouer [Mon, 23 Mar 2009 13:25:49 +0000 (14:25 +0100)] 
libiptc: fix chain rename bug in libiptc

Chain renaming (TC_RENAME_CHAIN) can result in an unsorted
chain list.  That breaks the requirement of the binary search
done in iptcc_bsearch_chain_index().

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: avoid compile warnings for iptc_insert_chain
Christoph Paasch [Mon, 23 Mar 2009 12:50:11 +0000 (13:50 +0100)] 
libiptc: avoid compile warnings for iptc_insert_chain

iptc_insert_chain is too big to get inlined and so it generates
a warning while compiling.

Signed-off-by: Christoph Paasch <christoph.paasch@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoiptables-save: module loading corrections
Jan Engelhardt [Thu, 19 Mar 2009 15:57:35 +0000 (16:57 +0100)] 
iptables-save: module loading corrections

1. Ignore the absence of /proc/net/ip_tables_names, which happens
when x_tables.ko is not loaded. This is equivalent to having
x_tables.ko, but no tabe modules, loaded. As such, success should
be returned.

2. Load table when explicitly requested by the -t option. Users might
expect "*foo" etc. to be output when `iptables-save -t foo` is
executed. So do autoload x_tables.ko and the table in this case.

*. Do this for both iptables-save and ip6tables-save, and adjust
the manpages for the new -M (modprobe program location) option that
is introduced.

Based upon a patch by Soren Hansen.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_comment: output quotes must be escaped in
Jan Engelhardt [Thu, 19 Mar 2009 10:57:10 +0000 (11:57 +0100)] 
libxt_comment: output quotes must be escaped in

Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519584
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: add -I/-L flags to pkgconfig files
Jan Engelhardt [Thu, 19 Mar 2009 09:38:41 +0000 (10:38 +0100)] 
libxtables: add -I/-L flags to pkgconfig files

These are needed in case iptables gets installed into a non-standard
path. It also enables automatic detection of these locations from 3rd
party programs via pkgconfig.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_connbytes: document nf_ct_acct behavior
Jan Engelhardt [Tue, 17 Mar 2009 15:37:47 +0000 (16:37 +0100)] 
libxt_connbytes: document nf_ct_acct behavior

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_connbytes: minor manpage adustments
Jan Engelhardt [Tue, 17 Mar 2009 15:32:49 +0000 (16:32 +0100)] 
libxt_connbytes: minor manpage adustments

Use explicit paragraph separator and conntrack(8).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoMerge commit 'nf/master'
Jan Engelhardt [Sun, 15 Mar 2009 20:26:53 +0000 (21:26 +0100)] 
Merge commit 'nf/master'

16 years agoiptables: turn deprecation warning into enforcing mode
Jan Engelhardt [Sun, 15 Mar 2009 20:22:49 +0000 (21:22 +0100)] 
iptables: turn deprecation warning into enforcing mode

The deprecation warning was added 7 months ago in v1.4.2-rc1-13-g1eada72
with a warning "next release". Next release is coming up, so enforce it.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoiptables: fix broken options-merging during libxtables rework
Pablo Neira Ayuso [Tue, 3 Mar 2009 16:46:17 +0000 (17:46 +0100)] 
iptables: fix broken options-merging during libxtables rework

This patch fixes options-merging that was broken somewhere
during the libxtables rework. Before this patch, two pointers
were used to keep the current options, however, the options field
in xt_params was not appropritely updated. Thus, xtables_free_opts()
was not restoring the original options.

This patch fixes iptables-restore and ip6tables-restore that
stopped working in my personal firewall.

% iptables-restore
*filter
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables-restore v1.4.3-rc1: Unknown arg `ESTABLISHED,RELATED'
Error occurred at line: 4
Try `iptables-restore -h' or 'iptables-restore --help' for more information.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agostring: fix wrong pattern length calculation
Pablo Neira Ayuso [Mon, 2 Mar 2009 10:46:55 +0000 (11:46 +0100)] 
string: fix wrong pattern length calculation

This fixes a problem introduced in 37b4bde745698bf140d74e59a2561f34deeb8726
that leads to the wrong calculation of the pattern length in the
string match.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoiptables: Add limits.h to get INT_MIN, INT_MAX, ...
Stephen Hemminger [Wed, 25 Feb 2009 07:25:17 +0000 (08:25 +0100)] 
iptables: Add limits.h to get INT_MIN, INT_MAX, ...

Fix build failure of iptables utilities on debian/ubuntu, maybe other distros.
The values INT_MIN and INT_MAX are used by many filters and these
are defined in limits.h
---
  patch against current iptables.git

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoextensions: add missing limits.h include
Jan Engelhardt [Sat, 21 Feb 2009 02:46:37 +0000 (03:46 +0100)] 
extensions: add missing limits.h include

Thanks to Stephen Hemminger for noticing.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>