]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
13 years agoMerge branch 'stable'
Pablo Neira Ayuso [Tue, 1 Nov 2011 12:39:06 +0000 (13:39 +0100)] 
Merge branch 'stable'

13 years agolibxt_NFQUEUE: fix --queue-bypass ipt-save output
Florian Westphal [Mon, 31 Oct 2011 15:10:57 +0000 (16:10 +0100)] 
libxt_NFQUEUE: fix --queue-bypass ipt-save output

else, this will print "--queue-num 0--queue-bypass ".

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoMerge branch 'stable'
Pablo Neira Ayuso [Wed, 28 Sep 2011 18:53:48 +0000 (20:53 +0200)] 
Merge branch 'stable'

13 years agoImprove readability of bitwise operation
Thomas Jarosch [Mon, 5 Sep 2011 20:25:39 +0000 (22:25 +0200)] 
Improve readability of bitwise operation

CLUSTERIP: improve readability of bitwise operation

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agolibxtables: Fix file descriptor leak in xtables_lmap_init on error
Thomas Jarosch [Wed, 28 Sep 2011 18:45:24 +0000 (20:45 +0200)] 
libxtables: Fix file descriptor leak in xtables_lmap_init on error

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoMerge branch 'stable'
Jan Engelhardt [Mon, 19 Sep 2011 11:44:18 +0000 (13:44 +0200)] 
Merge branch 'stable'

13 years agobuild: make check stage not fail when building statically
Jan Engelhardt [Sun, 18 Sep 2011 13:38:20 +0000 (15:38 +0200)] 
build: make check stage not fail when building statically

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agobuild: restore build order of modules
Jan Engelhardt [Sun, 18 Sep 2011 13:06:05 +0000 (15:06 +0200)] 
build: restore build order of modules

iptables(exe) requires libext.a, but extensions/ require libxtables.la
(in iptables/). This circular dependency does not work out, so
separate libxtables into its own directory and put it in front.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoip6tables-restore: make code look alike with iptables-restore
Jan Engelhardt [Sat, 27 Aug 2011 08:34:01 +0000 (10:34 +0200)] 
ip6tables-restore: make code look alike with iptables-restore

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibiptc: use a family-invariant xtc_ops struct for code reduction
Jan Engelhardt [Sat, 27 Aug 2011 10:50:32 +0000 (12:50 +0200)] 
libiptc: use a family-invariant xtc_ops struct for code reduction

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agosrc: resolve old macro names that are indirections
Jan Engelhardt [Sat, 27 Aug 2011 07:56:16 +0000 (09:56 +0200)] 
src: resolve old macro names that are indirections

Command used:

git grep -f <(pcregrep -hior
'(?<=#define\s)IP6?(T_\w+)(?=\s+X\1)' include/)

and then fix all occurrences.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibiptc: combine common types: _handle
Jan Engelhardt [Sat, 27 Aug 2011 09:39:52 +0000 (11:39 +0200)] 
libiptc: combine common types: _handle

No real API/ABI change incurred, since the definition of the structs'
types is not visible anyhow.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibiptc: replace ipt_chainlabel by xt_chainlabel
Jan Engelhardt [Sat, 27 Aug 2011 09:16:16 +0000 (11:16 +0200)] 
libiptc: replace ipt_chainlabel by xt_chainlabel

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibiptc: combine common types
Jan Engelhardt [Sat, 27 Aug 2011 09:12:49 +0000 (11:12 +0200)] 
libiptc: combine common types

Make an xt_chainlabel type out of ipt_chainlabel and ip6t_chainlabel,
and add backward-API #defines. The ABI naturally does not change
either, so no soversion bump.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibiptc: remove unused HOOK_DROPPING thing
Jan Engelhardt [Sat, 27 Aug 2011 08:59:31 +0000 (10:59 +0200)] 
libiptc: remove unused HOOK_DROPPING thing

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoiptables-save: remove binary dumping dead code
Jan Engelhardt [Sat, 27 Aug 2011 11:06:37 +0000 (13:06 +0200)] 
iptables-save: remove binary dumping dead code

Was never implemented, kill it.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibiptc: resolve compile failure
Jan Engelhardt [Sun, 11 Sep 2011 15:24:26 +0000 (17:24 +0200)] 
libiptc: resolve compile failure

  CC     libip4tc.lo
In file included from libip4tc.c:118:0:
libiptc.c:70:8: error: redefinition of "struct xt_error_target"
../include/linux/netfilter/x_tables.h:69:8: note: originally defined here

Remove libiptc's duplicate definition and substitute names.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoMerge branch 'stable'
Jan Engelhardt [Sun, 11 Sep 2011 15:14:04 +0000 (17:14 +0200)] 
Merge branch 'stable'

13 years agodoc: document iptables-restore's -T option
Jan Engelhardt [Sat, 27 Aug 2011 07:31:35 +0000 (09:31 +0200)] 
doc: document iptables-restore's -T option

Commit v1.4.0-rc1-12-ge8665f8 completely forgot this.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoip6tables-restore: implement missing -T option
Jan Engelhardt [Sat, 27 Aug 2011 07:29:30 +0000 (09:29 +0200)] 
ip6tables-restore: implement missing -T option

Commit v1.4.0-rc1-12-ge8665f8 forgot to port the change to the
ip6tables part.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agodoc: fix undesired newline in ip6tables-restore(8)
Jan Engelhardt [Sat, 27 Aug 2011 07:21:46 +0000 (09:21 +0200)] 
doc: fix undesired newline in ip6tables-restore(8)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agobuild: sort file list before build
Jan Engelhardt [Thu, 8 Sep 2011 15:08:37 +0000 (17:08 +0200)] 
build: sort file list before build

Manpage subsections are already sorted for obvious reasons. Since
$(wildcard) can actually return results unordered (just what the OS
can do) do the sorting with the .o file list too, for developer
comfort.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Jan Engelhardt [Thu, 8 Sep 2011 15:00:49 +0000 (17:00 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

13 years agoMerge branch 'stable'
Jan Engelhardt [Thu, 8 Sep 2011 14:07:16 +0000 (16:07 +0200)] 
Merge branch 'stable'

13 years agolibxt_CONNSECMARK: fix spacing in output
Tom Eastep [Sat, 3 Sep 2011 00:45:51 +0000 (17:45 -0700)] 
libxt_CONNSECMARK: fix spacing in output

~# iptables -t mangle -A foo -j CONNSECMARK --save
~# iptables -t mangle -S
[...]
-A foo -j CONNSECMARK--save

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoMerge branch 'stable' of git://dev.medozas.de/iptables
Jan Engelhardt [Mon, 5 Sep 2011 18:15:10 +0000 (20:15 +0200)] 
Merge branch 'stable' of git://dev.medozas.de/iptables

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoiptables: move kernel version find routing into libxtables
Jan Engelhardt [Sat, 3 Sep 2011 12:27:55 +0000 (14:27 +0200)] 
iptables: move kernel version find routing into libxtables

That way, the remaining unreferenced symbols that do appear in
libipt_DNAT and libipt_SNAT as part of the new check can be resolved,
and the ugly -rdynamic hack can finally be removed.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agobuild: scan for unreferenced symbols
Jan Engelhardt [Sat, 3 Sep 2011 12:11:53 +0000 (14:11 +0200)] 
build: scan for unreferenced symbols

To be notified of occurrences where we are missing any libraries, run
some ldd checks post building.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_RATEEST: link with -lm
Jan Engelhardt [Sat, 3 Sep 2011 11:35:53 +0000 (13:35 +0200)] 
libxt_RATEEST: link with -lm

$ ldd -r libxt_RATEEST.so
undefined symbol: log   (./libxt_RATEEST.so)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_statistic: link with -lm
Jan Engelhardt [Sat, 3 Sep 2011 11:34:40 +0000 (13:34 +0200)] 
libxt_statistic: link with -lm

$ ldd -r libxt_statistic.so
undefined symbol: lround        (./libxt_statistic.so)

References: https://bugs.archlinux.org/task/25358
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoBump version to 1.4.12.1 v1.4.12.1
Pablo Neira Ayuso [Thu, 1 Sep 2011 16:30:42 +0000 (18:30 +0200)] 
Bump version to 1.4.12.1

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 years agoinclude: refresh include files from kernel 3.1-rc3
Jan Engelhardt [Sun, 28 Aug 2011 12:19:43 +0000 (14:19 +0200)] 
include: refresh include files from kernel 3.1-rc3

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_addrtype: add support for revision 1
Jan Engelhardt [Sun, 28 Aug 2011 12:16:14 +0000 (14:16 +0200)] 
libxt_addrtype: add support for revision 1

Rev 1 was added to the kernel in commit v2.6.39-rc1~468^2~10^2~1 but
there was no corresponding iptables patch so far.

Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_addrtype: rename from libipt_addrtype
Jan Engelhardt [Sun, 28 Aug 2011 12:10:19 +0000 (14:10 +0200)] 
libxt_addrtype: rename from libipt_addrtype

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoxtoptions: simplify xtables_parse_interface
Richard Weinberger [Sat, 27 Aug 2011 13:32:31 +0000 (15:32 +0200)] 
xtoptions: simplify xtables_parse_interface

mask is already filled with zeros, there is no need to zero it again.

References: http://marc.info/?l=netfilter-devel&m=131445196526269&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_conntrack: improve error message on parsing violation
Tom Eastep [Thu, 18 Aug 2011 22:11:16 +0000 (15:11 -0700)] 
libxt_conntrack: improve error message on parsing violation

Tom Eastep noted:

$ iptables -A foo -m conntrack --ctorigdstport 22
iptables v1.4.12: conntrack rev 2 does not support port ranges
Try `iptables -h' or 'iptables --help' for more information.

Commit v1.4.12-41-g1ad6407 takes care of the actual cause of the bug,
but let's include Tom's patch nevertheless for the better error
message in case one actually does specify a range with rev 2.

References: http://marc.info/?l=netfilter-devel&m=131370592105298&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoxtoptions: fill in fallback value for nvals
Jan Engelhardt [Sat, 27 Aug 2011 15:59:52 +0000 (17:59 +0200)] 
xtoptions: fill in fallback value for nvals

Parsing for libxt_conntrack rev 2 is done by using rev 2's option
structure, which specifies XTTYPE_PORT, and using rev 3's parser
skeleton, which uses cb->nvals. Reading cb->nvals when not using
XTTYPE_PORTRC (or any other multi-value type) is undefined behavior.

Make it defined. Since XTTYPE_NONE is the only type that can take
void, nvals logically ought to be 1.

References: http://marc.info/?l=netfilter-devel&m=131370592105298&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_TOS: update linux kernel version list for backported fix
Fernando Luis Vázquez Cao [Tue, 2 Aug 2011 01:00:40 +0000 (10:00 +0900)] 
libxt_TOS: update linux kernel version list for backported fix

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_string: escape the escaping char too
Jan Engelhardt [Fri, 26 Aug 2011 12:46:40 +0000 (14:46 +0200)] 
libxt_string: escape the escaping char too

References: http://bugzilla.netfilter.org/show_bug.cgi?id=740
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agosrc: remove unused IPTABLES_MULTI define
Jan Engelhardt [Fri, 26 Aug 2011 10:45:02 +0000 (12:45 +0200)] 
src: remove unused IPTABLES_MULTI define

This dead code has been lingering around since commit v1.4.5~7.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_string: replace hex codes by char equivalents
Jan Engelhardt [Thu, 25 Aug 2011 10:11:20 +0000 (12:11 +0200)] 
libxt_string: replace hex codes by char equivalents

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_string: simplify hex output routine
Jan Engelhardt [Sun, 21 Aug 2011 11:16:16 +0000 (13:16 +0200)] 
libxt_string: simplify hex output routine

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_hashlimit: observe new default gc-expire time when saving
Jan Engelhardt [Sun, 21 Aug 2011 11:04:38 +0000 (13:04 +0200)] 
libxt_hashlimit: observe new default gc-expire time when saving

Since a while, --htable-gc-expire defaults to the chosen time quantum
instead of 10 fixed seconds, which leads the expiry value to be always
printed, which is redundant.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agotests: add negation tests for libxt_statistic
Jan Engelhardt [Sun, 21 Aug 2011 10:46:08 +0000 (12:46 +0200)] 
tests: add negation tests for libxt_statistic

Note: it is valid to check cb->invert before calling
xtables_option_parse.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_policy: remove superfluous inversion
Jan Engelhardt [Sun, 21 Aug 2011 10:39:04 +0000 (12:39 +0200)] 
libxt_policy: remove superfluous inversion

--dir cannot be inverted.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_physdev: restore inversion support
Jan Engelhardt [Sun, 21 Aug 2011 10:27:06 +0000 (12:27 +0200)] 
libxt_physdev: restore inversion support

Bug origin is in commit v1.4.11~26^2~4.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_owner: restore inversion support
Jan Engelhardt [Sun, 21 Aug 2011 10:25:06 +0000 (12:25 +0200)] 
libxt_owner: restore inversion support

Bug origin is in commit v1.4.11~16^2~7.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibipt_ttl: document that negation is available
Jan Engelhardt [Sun, 21 Aug 2011 10:11:15 +0000 (12:11 +0200)] 
libipt_ttl: document that negation is available

Glitch since commit v1.2.1~75.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibip6t_dst: restore setting IP6T_OPTS_LEN flag
Jan Engelhardt [Sun, 21 Aug 2011 09:59:58 +0000 (11:59 +0200)] 
libip6t_dst: restore setting IP6T_OPTS_LEN flag

Bug origin is in commit v1.4.11~26^2~18.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibip6t_hbh: restore setting IP6T_OPTS_LEN flag
Jan Engelhardt [Sun, 21 Aug 2011 09:54:01 +0000 (11:54 +0200)] 
libip6t_hbh: restore setting IP6T_OPTS_LEN flag

Bug origin is in commit v1.4.11~26^2~17.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_hashlimit: remove inversion from hashlimit rev 0
Jan Engelhardt [Sun, 21 Aug 2011 09:49:21 +0000 (11:49 +0200)] 
libxt_hashlimit: remove inversion from hashlimit rev 0

Revision 0 indeed did not have inversion support, nor presence of
--hashlimit-above. This glitch was added in v1.4.11~16^2~10.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibip6t_frag: restore inversion support
Jan Engelhardt [Sun, 21 Aug 2011 09:41:13 +0000 (11:41 +0200)] 
libip6t_frag: restore inversion support

--fraglen also was not printed since v1.4.11~26^2~22.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoxtoptions: flag use of XTOPT_POINTER without XTOPT_PUT
Jan Engelhardt [Sun, 21 Aug 2011 08:14:28 +0000 (10:14 +0200)] 
xtoptions: flag use of XTOPT_POINTER without XTOPT_PUT

When XTOPT_POINTER is used (and yields a non-zero offsetof), we can
flag the absence of XTOPT_PUT.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_conntrack: fix --ctproto 0 output
Jan Engelhardt [Sun, 21 Aug 2011 08:06:18 +0000 (10:06 +0200)] 
libxt_conntrack: fix --ctproto 0 output

First, we are missing XTOPT_PUT when trying to use XTOPT_POINTER.
(Next commit will flag this.) Furthermore, l4proto is of type
uint16_t, while XTTYPE_PROTOCOL wants a uint8_t so the idea would not
work => revert v1.4.12~1^2.

Bug goes back to v1.4.12~1^2.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_hashlimit: default htable-expire must be in milliseconds
Jan Engelhardt [Sun, 21 Aug 2011 07:46:12 +0000 (09:46 +0200)] 
libxt_hashlimit: default htable-expire must be in milliseconds

Bug goes back to v1.4.12~3^2~11.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_dscp: restore inversion support
Jan Engelhardt [Sun, 21 Aug 2011 06:52:56 +0000 (08:52 +0200)] 
libxt_dscp: restore inversion support

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_dccp: fix random output of ! on --dccp-option
Jan Engelhardt [Sun, 21 Aug 2011 07:39:21 +0000 (09:39 +0200)] 
libxt_dccp: fix random output of ! on --dccp-option

dccp-option tests info->typemask, but it really should look at
info->invflags instead.

This bug goes back to commit v1.3.4~11.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_dccp: provide man pages options in short help too
Jan Engelhardt [Sun, 21 Aug 2011 07:15:20 +0000 (09:15 +0200)] 
libxt_dccp: provide man pages options in short help too

This omission goes back to commit v1.3.4~11.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_dccp: spell out option name on save
Jan Engelhardt [Sun, 21 Aug 2011 07:12:27 +0000 (09:12 +0200)] 
libxt_dccp: spell out option name on save

This glitch goes back to commit v1.3.4~11.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_dccp: fix deprecated intrapositional ordering of !
Jan Engelhardt [Sun, 21 Aug 2011 07:08:04 +0000 (09:08 +0200)] 
libxt_dccp: fix deprecated intrapositional ordering of !

This bug goes back to v1.4.3~63.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_dccp: restore missing XTOPT_INVERT tags for options
Jan Engelhardt [Sun, 21 Aug 2011 07:05:31 +0000 (09:05 +0200)] 
libxt_dccp: restore missing XTOPT_INVERT tags for options

This regression goes back to v1.4.11~19^2.

References: Dave Täht via netfilter-devel on 2011-08-20 14:40:11 -0700
References: <CAA93jw6mpDL6rLXM+9SpAhafkDdKoSfhAxU8UM87vUqjuzjYJw@mail.gmail.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_conntrack: remove one misleading comment
Jan Engelhardt [Sun, 21 Aug 2011 06:46:49 +0000 (08:46 +0200)] 
libxt_conntrack: remove one misleading comment

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agodoc: clarify libxt_connlimit defaults
Jan Engelhardt [Sun, 21 Aug 2011 06:43:15 +0000 (08:43 +0200)] 
doc: clarify libxt_connlimit defaults

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_string: fix space around arguments
Dwight Davis [Fri, 12 Aug 2011 21:02:09 +0000 (17:02 -0400)] 
libxt_string: fix space around arguments

Fix oversight from commit v1.4.11~80.

References: http://bugs.debian.org/637499
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_set: put differing variable names in directly
Jan Engelhardt [Sat, 20 Aug 2011 19:00:45 +0000 (21:00 +0200)] 
libxt_set: put differing variable names in directly

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agodoc: fix typo in libxt_TRACE
Bernard Massot [Wed, 10 Aug 2011 12:56:00 +0000 (14:56 +0200)] 
doc: fix typo in libxt_TRACE

References: http://bugzilla.netfilter.org/show_bug.cgi?id=736
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_tcp: always print the mask parts
Jan Engelhardt [Sat, 20 Aug 2011 16:26:48 +0000 (18:26 +0200)] 
libxt_tcp: always print the mask parts

0xFF is unlikely to happen (given that ALL translates to 0x3F at
most), but assuming that through magic, 0xFF was put into memory,
iptables -S/iptables-save would ignore printing it, practically
outputting just one argument to --tcp-flags which currently wants two.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_set: update man page about kernel support on the feature
Jan Engelhardt [Sat, 20 Aug 2011 16:26:34 +0000 (18:26 +0200)] 
libxt_set: update man page about kernel support on the feature

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agolibxt_u32: fix missing allowance for inversion
Jan Engelhardt [Mon, 15 Aug 2011 15:06:20 +0000 (17:06 +0200)] 
libxt_u32: fix missing allowance for inversion

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Tue, 9 Aug 2011 11:23:17 +0000 (13:23 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

14 years agolibipq: add pkgconfig file
Jan Engelhardt [Mon, 8 Aug 2011 00:38:41 +0000 (02:38 +0200)] 
libipq: add pkgconfig file

This is just to make sure that projects (still) using it do so with
the right cflags, e.g. for when the include file ends up in a
non-standard location due to ./configure having been called with
--include=/somewhere/else.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: abort autogen on subcommand failure
Jan Engelhardt [Mon, 1 Aug 2011 19:26:01 +0000 (21:26 +0200)] 
build: abort autogen on subcommand failure

Needed to stop an automated build process when automake requirements
are not fulfilled.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: strengthen check for overlong lladdr components
Jan Engelhardt [Mon, 1 Aug 2011 18:22:04 +0000 (20:22 +0200)] 
build: strengthen check for overlong lladdr components

ethermac[i] > UINT8_MAX is quite pointless, because ethermac[i] is
just uint8_t. To catch values that are not in the range "00"-"ff", use
a string length check (end-arg>2). I am willingly using 2 there,
because no one is going to specify an Ethernet LL address as
"0x00:0x24:0xbe:0xc2:0x7f:0x16" -- because it is always interpreted as
hexadecimal anyway even without the 0x prefix.

xtoptions.c: In function "xtopt_parse_ethermac":
xtoptions.c:760:3: warning: comparison is always false due to limited range of data type
xtoptions.c:766:2: warning: comparison is always false due to limited range of data type

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: workaround broken linux-headers on RHEL-5
Jan Engelhardt [Mon, 1 Aug 2011 18:14:57 +0000 (20:14 +0200)] 
build: workaround broken linux-headers on RHEL-5

maigc.h was not invented yet, but they do not
ship proc_fs.h either, duh.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_string: define _GNU_SOURCE for strnlen
Jan Engelhardt [Mon, 1 Aug 2011 18:08:42 +0000 (20:08 +0200)] 
libxt_string: define _GNU_SOURCE for strnlen

On RHEL-5.6 and clones with its gcc-4.1.2 and glibc-2.5:

libxt_string.c: In function "parse_string":
libxt_string.c:84: warning: implicit declaration of function "strnlen"

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoBump version to 1.4.12 v1.4.12
Patrick McHardy [Fri, 22 Jul 2011 12:37:34 +0000 (14:37 +0200)] 
Bump version to 1.4.12

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agolibxt_TCPMSS: restore build with IPv6-less libcs
Jan Engelhardt [Fri, 22 Jul 2011 10:25:43 +0000 (12:25 +0200)] 
libxt_TCPMSS: restore build with IPv6-less libcs

Commit v1.4.10-149-gea2a02f added an netinet/ip6.h include, which is
not available on systems without IPv6 header files.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoextensions: use multi-target registration
Jan Engelhardt [Fri, 22 Jul 2011 10:11:03 +0000 (12:11 +0200)] 
extensions: use multi-target registration

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Mon, 11 Jul 2011 08:41:10 +0000 (10:41 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

14 years agolibxt_conntrack: move more data into the xt_option_entry
Jan Engelhardt [Sun, 10 Jul 2011 11:13:49 +0000 (13:13 +0200)] 
libxt_conntrack: move more data into the xt_option_entry

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_conntrack: restore network-byte order for v1,v2
Jan Engelhardt [Sun, 10 Jul 2011 10:48:42 +0000 (12:48 +0200)] 
libxt_conntrack: restore network-byte order for v1,v2

References: http://bugs.debian.org/632804
References: http://marc.info/?l=netfilter-devel&m=130999299016674&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: set clone's initial data to NULL
Jan Engelhardt [Sun, 10 Jul 2011 09:47:46 +0000 (11:47 +0200)] 
libxtables: set clone's initial data to NULL

Avoid a crash in xs_init_match when a clone's m->udata points at the
parent.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agooption: remove last traces of intrapositional negation
Jan Engelhardt [Sat, 9 Jul 2011 17:37:31 +0000 (19:37 +0200)] 
option: remove last traces of intrapositional negation

Intrapositional negation was deprecated in 1.4.3.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: ignore whitespace in the multiaddress argument parser
Jan Engelhardt [Sat, 9 Jul 2011 14:19:09 +0000 (16:19 +0200)] 
libxtables: ignore whitespace in the multiaddress argument parser

References: http://bugzilla.netfilter.org/show_bug.cgi?id=727
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: properly reject empty hostnames
Jan Engelhardt [Sat, 9 Jul 2011 14:01:18 +0000 (16:01 +0200)] 
libxtables: properly reject empty hostnames

An empty hostname in the address list of an -s/-d argument, which may
be the result of a typo, is interpreted as 0/0, which, when combined
with -j ACCEPT, leads to an undesired opening of the firewall.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=727
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Tue, 5 Jul 2011 13:16:05 +0000 (15:16 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

14 years agoiptables: restore negation for -f
Jan Engelhardt [Tue, 5 Jul 2011 13:08:37 +0000 (15:08 +0200)] 
iptables: restore negation for -f

This move was missed in commit v1.4.11~77^2~6.

References: http://bugs.debian.org/632695
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: the -m option cannot be inverted
Jan Engelhardt [Mon, 4 Jul 2011 11:04:16 +0000 (13:04 +0200)] 
doc: the -m option cannot be inverted

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: fix version string in ip6tables.8
Jan Engelhardt [Mon, 4 Jul 2011 11:02:51 +0000 (13:02 +0200)] 
doc: fix version string in ip6tables.8

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: install modules in arch-dependent location
Jan Engelhardt [Mon, 4 Jul 2011 10:44:43 +0000 (12:44 +0200)] 
build: install modules in arch-dependent location

Make it possible to have multiple types of ELF classes for the
extension modules by putting them in an arch-dependent path.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Thu, 30 Jun 2011 11:35:56 +0000 (13:35 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

14 years agodoc: mention multiple verbosity flags
Jan Engelhardt [Thu, 30 Jun 2011 11:19:15 +0000 (13:19 +0200)] 
doc: mention multiple verbosity flags

"-vv" can be used to further increase the verbosity level. Document
this.

References: http://bugs.debian.org/616037
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoiptables-apply: select default rule file depending on call name
Martin F. Krafft [Tue, 22 Sep 2009 19:07:13 +0000 (21:07 +0200)] 
iptables-apply: select default rule file depending on call name

ip6tables-apply points to iptables-apply (which is good). Since
iptables/ip6tables rule files are different, the reporter suggests
that the DEFAULT_FILE variable should depend on whether iptables-apply
or ip6tables-apply is run.

References: http://bugs.debian.org/547734
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: attempt to fix building under Linux 2.4
Jan Engelhardt [Fri, 24 Jun 2011 18:16:48 +0000 (20:16 +0200)] 
build: attempt to fix building under Linux 2.4

iptables no longer compiles for Linux 2.4 because it uses
linux/magic.h. This header and the PROC_SUPER_MAGIC macro are only for
Linux 2.6.

xtables.c:35:52: error: linux/magic.h: No such file or directory
xtables.c: In function 'proc_file_exists':
xtables.c:389: error: 'PROC_SUPER_MAGIC' undeclared (first use in
this function)
xtables.c:389: error: (Each undeclared identifier is reported only
once for each function it appears in.)

References: http://bugzilla.netfilter.org/show_bug.cgi?id=720
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: fix group range in libxt_NFLOG's man
Jakub Zawadzki [Mon, 13 Jun 2011 11:54:33 +0000 (13:54 +0200)] 
doc: fix group range in libxt_NFLOG's man

References: http://bugzilla.netfilter.org/show_bug.cgi?id=723
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_RATEEST: fix userspacesize field
Massimo Maggi [Wed, 15 Jun 2011 00:52:00 +0000 (02:52 +0200)] 
libxt_RATEEST: fix userspacesize field

I cannot delete a rule by matching it if the target of the rule is
RATEEST.

Copy-paste from terminal:

# iptables -t mangle -A PREROUTING -j RATEEST
--rateest-name somename --rateest-interval 250ms
--rateest-ewmalog 4s
# iptables -t mangle -D PREROUTING -j RATEEST
--rateest-name somename --rateest-interval 250ms
--rateest-ewmalog 4s
iptables: No chain/target/match by that name.

I saw in comments of the kernel code that the last part of the struct
xt_rateest_target_info is used only by kernel:

struct xt_rateest_target_info {
char name[IFNAMSIZ];
__s8 interval;
__u8 ewma_log;

/* Used internally by the kernel */
struct xt_rateest *est __attribute__((aligned(8)));
};

but in struct xtables_target, .size and .userspacesize are equal.
Simply correcting this solved the problem.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=724
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoiptables: Coverity: RESOURCE_LEAK
Jiri Popelka [Fri, 10 Jun 2011 13:26:02 +0000 (15:26 +0200)] 
iptables: Coverity: RESOURCE_LEAK

xtables.c:320: alloc_fn: Calling allocation function "get_modprobe".
xtables.c:294: alloc_fn: Storage is returned from allocation function "malloc".
xtables.c:294: var_assign: Assigning: "ret" = "malloc(1024UL)".
xtables.c:304: return_alloc: Returning allocated memory "ret".
xtables.c:320: var_assign: Assigning: "buf" =  storage returned from "get_modprobe()".
xtables.c:323: var_assign: Assigning: "modprobe" = "buf".
xtables.c:348: leaked_storage: Variable "buf" going out of scope
               leaks the storage it points to.
xtables.c:348: leaked_storage: Returning without freeing "modprobe"
               leaks the storage that it points to.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoiptables: Coverity: VARARGS
Jiri Popelka [Fri, 10 Jun 2011 13:26:00 +0000 (15:26 +0200)] 
iptables: Coverity: VARARGS

xtables.c:931: va_init: Initializing va_list "args".
xtables.c:938: missing_va_end: va_end was not called for "args".
xtables.c:947: missing_va_end: va_end was not called for "args".
xtables.c:961: missing_va_end: va_end was not called for "args".

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoiptables: Coverity: REVERSE_INULL
Jiri Popelka [Fri, 10 Jun 2011 13:25:58 +0000 (15:25 +0200)] 
iptables: Coverity: REVERSE_INULL

ip6tables-restore.c:186: deref_ptr_in_call: Dereferencing pointer "in".
ip6tables-restore.c:463: check_after_deref: Dereferencing "in"
before a null check.
iptables-restore.c:192: deref_ptr_in_call: Dereferencing pointer "in".
iptables-restore.c:468: check_after_deref: Dereferencing "in" before a
null check.
iptables-xml.c:671: deref_ptr_in_call: Dereferencing pointer "in".
iptables-xml.c:873: check_after_deref: Dereferencing "in" before a
null check.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoiptables: Coverity: NEGATIVE_RETURNS
Jiri Popelka [Fri, 10 Jun 2011 13:25:57 +0000 (15:25 +0200)] 
iptables: Coverity: NEGATIVE_RETURNS

libipq.c:232: var_tested_neg: Variable "h->fd" tests negative.
libipq.c:234: negative_returns: "h->fd" is passed to a parameter that
cannot be negative.

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