]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
15 years agoiptables 1.4.7 v1.4.7
Patrick McHardy [Mon, 1 Mar 2010 14:11:28 +0000 (15:11 +0100)] 
iptables 1.4.7

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agolibip4tc: Add static qualifier to dump_entry()
Dmitry V. Levin [Thu, 18 Feb 2010 17:08:31 +0000 (18:08 +0100)] 
libip4tc: Add static qualifier to dump_entry()

Change dump_entry() signature defined in libip4tc.c to match prototype
declared in libiptc.c and another static dump_entry() function defined
in libip6tc.c.  This function is not a part of the public libiptc API.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoLift restrictions on interface names
Jan Engelhardt [Tue, 9 Feb 2010 14:59:13 +0000 (15:59 +0100)] 
Lift restrictions on interface names

The kernel has few restrictions.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoincludes: header updates
Jan Engelhardt [Sun, 31 Jan 2010 21:42:52 +0000 (22:42 +0100)] 
includes: header updates

Update the shipped Linux kernel headers from 2.6.33-rc6, as
iptables's ipt_ECN.h for example references ipt_DSCP.h, which no
longer exists.

Since a number of old code pieces have been removed in the kernel in
that fashion, the structs for older versions are moved into the .c
file, to keep header updating simple.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agopolicy: fix error message showing wrong option
Jan Engelhardt [Sun, 31 Jan 2010 15:49:50 +0000 (16:49 +0100)] 
policy: fix error message showing wrong option

15 years agodoc: mention requirement of additional packages for ipset
Jan Engelhardt [Tue, 19 Jan 2010 17:47:43 +0000 (18:47 +0100)] 
doc: mention requirement of additional packages for ipset

References: https://bugzilla.novell.com/561177
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: fix limit manpage to reflect actual supported syntax
Jan Engelhardt [Tue, 19 Jan 2010 17:18:24 +0000 (18:18 +0100)] 
doc: fix limit manpage to reflect actual supported syntax

References: https://bugzilla.novell.com/561179
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: fix recent manpage to reflect actual supported syntax
Jan Engelhardt [Tue, 19 Jan 2010 17:15:19 +0000 (18:15 +0100)] 
doc: fix recent manpage to reflect actual supported syntax

References: https://bugzilla.novell.com/561180
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agorecent: reorder cases in code (cosmetic cleanup)
Jan Engelhardt [Tue, 19 Jan 2010 17:13:23 +0000 (18:13 +0100)] 
recent: reorder cases in code (cosmetic cleanup)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibipq: build as shared library
Jan Engelhardt [Mon, 28 Dec 2009 01:46:27 +0000 (02:46 +0100)] 
libipq: build as shared library

Antique software (see link) built as shared library requires objects
compiled with -fPIC, so the standard archive won't do.

References: http://bugs.debian.org/527733
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoBump version to v1.4.6 v1.4.6
Patrick McHardy [Wed, 9 Dec 2009 14:12:05 +0000 (15:12 +0100)] 
Bump version to v1.4.6

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Tue, 24 Nov 2009 15:11:46 +0000 (16:11 +0100)] 
Merge branch 'master' of git://dev.medozas.de/iptables

15 years agoconntrack: fix --expires parsing
Patrick McHardy [Fri, 20 Nov 2009 13:58:11 +0000 (14:58 +0100)] 
conntrack: fix --expires parsing

Using ranges in --ctexpire results in a parsing error:

conntrack: Bad value for "--expires" option: "1:1000"

The first value is parsed twice, after which the end pointer doesn't
point to the expected '\0' but to the colon.

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agodoc: name resolution clarification
Jan Engelhardt [Tue, 17 Nov 2009 23:00:37 +0000 (00:00 +0100)] 
doc: name resolution clarification

Sometimes there are users who wonder about when name resolutions/DNS
queries are done, so let's add that for completeness.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: explain experienced --hitcount limit
Jan Engelhardt [Tue, 17 Nov 2009 22:54:29 +0000 (23:54 +0100)] 
doc: explain experienced --hitcount limit

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoiptables: take masks into consideration for replace command
Jan Engelhardt [Sun, 15 Nov 2009 14:51:27 +0000 (15:51 +0100)] 
iptables: take masks into consideration for replace command

The two commands:

-A OUPUT -d 10.11.12.13/32 -j LOG
-R OUTPUT 1 -j LOG -d 10.11.12.13

will replace 10.11.12.13/32 by 10.11.12.13/0, which is not right.
(No regression, this problem was there forever.)

Reported-by: Werner Pawlitschko <werner.pawlitschko@arcor.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoextensions: add osf extension
Patrick McHardy [Thu, 12 Nov 2009 12:01:30 +0000 (13:01 +0100)] 
extensions: add osf extension

From Evgeniy Polyakov <zbr@ioremap.net>

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoDNAT: fix incorrect check during parsing
Patrick McHardy [Fri, 6 Nov 2009 16:15:07 +0000 (17:15 +0100)] 
DNAT: fix incorrect check during parsing

Specifying --random before --to-dest results in:

Multiple --to-destination not supported

Fix the flags check to only test the IPT_DNAT_OPT_DEST bit.

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoCONNMARK: print mark rules with mask 0xffffffff as set instead of xset
Jan Engelhardt [Wed, 4 Nov 2009 12:10:50 +0000 (13:10 +0100)] 
CONNMARK: print mark rules with mask 0xffffffff as set instead of xset

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoMARK: print mark rules with mask 0xffffffff as --set-mark instead of --set-xmark
Patrick McHardy [Wed, 4 Nov 2009 12:03:50 +0000 (13:03 +0100)] 
MARK: print mark rules with mask 0xffffffff as --set-mark instead of --set-xmark

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoiptables/extensions: make bundled options work again
Jan Engelhardt [Fri, 23 Oct 2009 22:45:33 +0000 (00:45 +0200)] 
iptables/extensions: make bundled options work again

When using a bundled option like "-ptcp", 'argv[optind-1]' would
logically point to "-ptcp", but this is obviously not right.
'optarg' is needed instead, which if properly offset to "tcp".

Not all places change optind-based access to optarg; where
look-ahead is needed, such as for tcp's --tcp-flags option for
example, optind is ok.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=611
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibxtables: hand argv to xtables_check_inverse
Jan Engelhardt [Tue, 3 Nov 2009 18:55:11 +0000 (19:55 +0100)] 
libxtables: hand argv to xtables_check_inverse

In going to fix NF bug #611, "argv" is needed in
xtables_check_inverse to set "optarg" to the right spot in case of an
intrapositional negation.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=611
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agostyle: reduce indent in xtables_check_inverse
Jan Engelhardt [Fri, 23 Oct 2009 22:08:09 +0000 (00:08 +0200)] 
style: reduce indent in xtables_check_inverse

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoiptables: fix undersized deletion mask creation
Jan Engelhardt [Tue, 27 Oct 2009 01:59:33 +0000 (02:59 +0100)] 
iptables: fix undersized deletion mask creation

The mask created for the -D rulespec is simply too small.
xtables_targets points to whatever target has last been loaded, so
xtables_targets->size is quite almost wrong, as we need to use the
size of the target for the specific rule that is about to be deleted.

This bug existed ever since iptables history is tracked, and requires
certain circumstances to be visible, where the deletion operation is
one. Furthermore, multiple userspace target extensions must have been
loaded, and a target B whose .size is smaller than the target A of
the rule we are about to delete must have been loaded more recently
than target A. The minimal testcase is (rule 60007 gets wrongly
removed)

*nat
-F
-X
-A POSTROUTING -p udp -j SNAT --to 192.168.1.1:60007
-A POSTROUTING -p udp -j SNAT --to 192.168.1.1:60008
-A POSTROUTING -p udp -j CONNMARK --set-mark 0
-D POSTROUTING -p udp -j SNAT --to 192.168.1.1:60008
COMMIT

References: http://bugzilla.netfilter.org/show_bug.cgi?id=606
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
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>