]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
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 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>
14 years agoiptables: Coverity: DEADCODE
Jiri Popelka [Fri, 10 Jun 2011 13:25:55 +0000 (15:25 +0200)] 
iptables: Coverity: DEADCODE

libiptc.c:407: dead_error_condition: On this path, the condition
"res > 0" cannot be false.
libiptc.c:396: at_least: After this line, the value of "res" is at
least 1.
libiptc.c:393: equality_cond: Condition "res == 0" is evaluated as
false.
libiptc.c:396: new_values: Noticing condition "res < 0".
libiptc.c:425: new_values: Noticing condition "res < 0".
libiptc.c:407: new_values: Noticing condition "res > 0".
libiptc.c:435: dead_error_line: Execution cannot reach this statement
"return list_pos;".

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: bump soversion for recent data structure change
Jan Engelhardt [Wed, 22 Jun 2011 13:42:48 +0000 (15:42 +0200)] 
build: bump soversion for recent data structure change

Cf. commit v1.4.11.1-5-g2dba676.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_hashlimit: use a more obvious expiry value by default
Jan Engelhardt [Wed, 22 Jun 2011 09:18:19 +0000 (11:18 +0200)] 
libxt_hashlimit: use a more obvious expiry value by default

Due to the previous default expiry of 10 sec, "--hashlimit 1/min"
would allow matching up to 6/min if a properly timed. To do what the
user expects, the minimum expiry must equal the selected time quantum
however.

Cc: Jan Rovner <jan.rovner@diadema.cz>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_state: fix regression about inversion of main option
Jan Engelhardt [Wed, 22 Jun 2011 09:15:34 +0000 (11:15 +0200)] 
libxt_state: fix regression about inversion of main option

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibip6t_HL: fix option names from ttl -> hl
Jan Engelhardt [Wed, 22 Jun 2011 08:15:07 +0000 (10:15 +0200)] 
libip6t_HL: fix option names from ttl -> hl

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_RATEEST: abolish global variables
Jan Engelhardt [Tue, 21 Jun 2011 12:22:20 +0000 (14:22 +0200)] 
libxt_RATEEST: abolish global variables

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_rateest: abolish global variables
Jan Engelhardt [Tue, 21 Jun 2011 07:54:31 +0000 (09:54 +0200)] 
libxt_rateest: abolish global variables

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoextensions: support for per-extension instance "global" variable space
Jan Engelhardt [Sat, 18 Jun 2011 19:34:25 +0000 (21:34 +0200)] 
extensions: support for per-extension instance "global" variable space

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoiptables: consolidate target/match init call
Jan Engelhardt [Sat, 18 Jun 2011 19:18:29 +0000 (21:18 +0200)] 
iptables: consolidate target/match init call

This is useful for the upcoming patch about per-instance auxiliary
data.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_RATEEST: use guided option parser
Jan Engelhardt [Tue, 21 Jun 2011 12:20:15 +0000 (14:20 +0200)] 
libxt_RATEEST: use guided option parser

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibipt_LOG: fix ignoring all but last flags
Jan Engelhardt [Tue, 21 Jun 2011 15:00:45 +0000 (17:00 +0200)] 
libipt_LOG: fix ignoring all but last flags

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: document IPv6 TOS mangling bug in old Linux kernels
Fernando Luis Vazquez Cao [Fri, 17 Jun 2011 03:46:22 +0000 (05:46 +0200)] 
doc: document IPv6 TOS mangling bug in old Linux kernels

In Linux kernels up to and including 2.6.38, with the exception of longterm
releases 2.6.32.42 (or later) and 2.6.33.15 (or later), there is a bug (*) whereby
IPv6 TOS mangling does not behave as documented and differs from the IPv4
version. The TOS mask indicates the bits one wants to zero out, so it needs to
be inverted before applying it to the original TOS field. However, the
aformentioned kernels forgo the inversion which breaks --set-tos and its
mnemonics.

(*) Fixed by upstream commit:
    1ed2f73d90fb49bcf5704aee7e9084adb882bfc5 (netfilter: IPv6: fix DSCP mangle code)

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agodoc: include matches/targets in manpage again
Jan Engelhardt [Thu, 9 Jun 2011 13:24:49 +0000 (15:24 +0200)] 
doc: include matches/targets in manpage again

Evil sed did not throw any warning whatsoever when it cannot find the
file.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoBump version to 1.4.11.1 v1.4.11.1
Patrick McHardy [Wed, 8 Jun 2011 13:26:17 +0000 (15:26 +0200)] 
Bump version to 1.4.11.1

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agodoc: fix MASQUERADE section of man page
Vlad Dogaru [Wed, 8 Jun 2011 12:44:06 +0000 (14:44 +0200)] 
doc: fix MASQUERADE section of man page

The section about MASQUERADE specifies that it takes a single option,
but in reality it takes two: --to-ports and --random.

Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agobuild: re-add missing CPPFLAGS for libiptc
Jan Engelhardt [Wed, 8 Jun 2011 10:28:24 +0000 (12:28 +0200)] 
build: re-add missing CPPFLAGS for libiptc

These got lost on commit v1.4.11-12-g5c8f5b6.

Note: When /usr/include/libiptc/libiptc.h exists, this error is
masked away :-/  (IMO, #include-with-quotes "foo.h" should not
search system dirs...)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agooption: fix ignored negation before implicit extension loading
Jan Engelhardt [Tue, 7 Jun 2011 20:20:13 +0000 (22:20 +0200)] 
option: fix ignored negation before implicit extension loading

`iptables -A INPUT -p tcp ! --syn` forgot the negation, i.e. it
was not present in a subsequent `iptables -S`.

Commit v1.4.11~77^2~9 missed the fact that after autoloading a proto
extension, cs.invert must not be touched until the next getopt call.
This is now fixed by having command_default return a value to indicate
whether to jump or not.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agotests: add some sample rulesets to test save-restore cycle
Jan Engelhardt [Tue, 7 Jun 2011 17:06:51 +0000 (19:06 +0200)] 
tests: add some sample rulesets to test save-restore cycle

These rulesets use practically all options (I may have missed some)
for verification that the new Guided Option Parser would take the same
input as the old open-coded ones did. They might come in handy at some
point.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agosrc: move all iptables pieces into a separate directory
Jan Engelhardt [Tue, 7 Jun 2011 12:02:37 +0000 (14:02 +0200)] 
src: move all iptables pieces into a separate directory

(Unclutter top-level dir)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agosrc: move all libiptc pieces into its directory
Jan Engelhardt [Tue, 7 Jun 2011 09:42:03 +0000 (11:42 +0200)] 
src: move all libiptc pieces into its directory

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoxtables-multi: fix absence of xml translator in IPv6-only builds
Maciej Å»enczykowski [Tue, 7 Jun 2011 01:27:09 +0000 (18:27 -0700)] 
xtables-multi: fix absence of xml translator in IPv6-only builds

Commit v1.4.11-4-gde791ff did not actually build the iptables-xml code
into the xtables-multi binary.

Signed-off-by: Maciej Zenczykowski <maze@google.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: fix trivial typo in libipt_SNAT
Elie De Brauwer [Mon, 7 Mar 2011 20:29:16 +0000 (21:29 +0100)] 
doc: fix trivial typo in libipt_SNAT

The word "occur" had ufortunately been removed in v1.3.8~23.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=707
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: move remaining preprocessor flags to CPPFLAGS
Mike Frysinger [Sun, 3 Apr 2011 02:13:23 +0000 (22:13 -0400)] 
build: move remaining preprocessor flags to CPPFLAGS

References; http://bugzilla.netfilter.org/show_bug.cgi?id=713
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: move kinclude's preprocessor flags to kinclude_CPPFLAGS
Jan Engelhardt [Wed, 1 Jun 2011 00:20:40 +0000 (02:20 +0200)] 
build: move kinclude's preprocessor flags to kinclude_CPPFLAGS

References: http://bugzilla.netfilter.org/show_bug.cgi?id=713
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: move basic preprocessor flags to regular_CPPFLAGS
Jan Engelhardt [Wed, 1 Jun 2011 00:16:05 +0000 (02:16 +0200)] 
build: move basic preprocessor flags to regular_CPPFLAGS

This is where they belong, after all.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=713
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: iptables-xml should be in manpage section 1
Jan Engelhardt [Mon, 30 May 2011 00:25:43 +0000 (02:25 +0200)] 
doc: iptables-xml should be in manpage section 1

References: http://bugs.debian.org/623112
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: update GPL license text
Jan Engelhardt [Sun, 29 May 2011 23:54:28 +0000 (01:54 +0200)] 
doc: update GPL license text

The Open Build Service/rpmlint flagged the outdated address in the
license text :-)

iptables.x86_64: W: incorrect-fsf-address
/usr/share/doc/packages/iptables/COPYING
The Free Software Foundation address in this file seems to be outdated
or misspelled.  Ask upstream to update the address, or if this is a
license file, possibly the entire file with a new copy available from
the FSF.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: fix absence of xml translator in IPv6-only builds
Jan Engelhardt [Sun, 29 May 2011 23:47:38 +0000 (01:47 +0200)] 
build: fix absence of xml translator in IPv6-only builds

Due to iptables-xml being listed under IPV4 only, its symlink was not
created on `./configure --disable-ipv4 && make install`.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: fix installation of symlinks
Jan Engelhardt [Sun, 29 May 2011 23:45:14 +0000 (01:45 +0200)] 
build: fix installation of symlinks

Commit v1.4.11~20 forgot to change the symlink target names to the new
executable name.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: remove dead code parts
Jan Engelhardt [Sun, 29 May 2011 23:39:54 +0000 (01:39 +0200)] 
build: remove dead code parts

gcc-4.6 has a new warning, -Wunused-but-set-variable, which flags
no-op code.

  CC     libiptc/libip4tc.lo
In file included from libiptc/libip4tc.c:118:0:
libiptc/libiptc.c: In function "iptcc_chain_index_delete_chain":
libiptc/libiptc.c:611:32: warning: variable "index_ptr2" set but not used
libiptc/libiptc.c: In function "alloc_handle":
libiptc/libiptc.c:1282:9: warning: variable "len" set but not used
  CC     libiptc/libip6tc.lo
In file included from libiptc/libip6tc.c:113:0:
libiptc/libiptc.c: In function "iptcc_chain_index_delete_chain":
libiptc/libiptc.c:611:32: warning: variable "index_ptr2" set but not used
libiptc/libiptc.c: In function "alloc_handle":
libiptc/libiptc.c:1282:9: warning: variable "len" set but not used
  CC     xtables_multi-iptables-xml.o
iptables-xml.c: In function "do_rule_part":
iptables-xml.c:376:8: warning: variable "thisChain" set but not used
  CC     xtables_multi-ip6tables.o
ip6tables.c: In function "print_firewall":
ip6tables.c:552:10: warning: variable "flags" set but not used

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_owner: restore inversion support
Jan Engelhardt [Sun, 29 May 2011 14:43:25 +0000 (16:43 +0200)] 
libxt_owner: restore inversion support

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoBump version to 1.4.11 v1.4.11
Patrick McHardy [Thu, 26 May 2011 16:12:12 +0000 (18:12 +0200)] 
Bump version to 1.4.11

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Wed, 25 May 2011 03:34:04 +0000 (05:34 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

14 years agolibxt_time: deprecate --localtz option, document kernel TZ caveats
Jan Engelhardt [Mon, 23 May 2011 16:38:09 +0000 (18:38 +0200)] 
libxt_time: deprecate --localtz option, document kernel TZ caveats

Comparing against the kernel time zone has significant caveats. This
patch adds documentation about the issue, and makes --utc the default
setting for libxt_time.

Furthremore, throw a warning on using the "--localtz" option, to avoid
confusion with one's shell TZ environment variable, and rename it to
"--kerneltz" to be explicit about whose timezone will be used.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_time: --utc and --localtz are mutually exclusive
Jan Engelhardt [Mon, 23 May 2011 15:48:20 +0000 (17:48 +0200)] 
libxt_time: --utc and --localtz are mutually exclusive

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_time: always ignore libc timezone
Jan Engelhardt [Mon, 23 May 2011 15:42:37 +0000 (17:42 +0200)] 
libxt_time: always ignore libc timezone

Since xt_time is meant to work across many months, libc doing
automatic conversion from local time to UTC (during parse) is
unwanted, especially when --utc is specified. The same goes for
dumping.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_NFQUEUE: add mutual exclusion between qnum and qbal
Jan Engelhardt [Tue, 24 May 2011 22:26:01 +0000 (00:26 +0200)] 
libxt_NFQUEUE: add mutual exclusion between qnum and qbal

Only one is printed on save operation, which leads me to believe that
only one is meant to be used. The manpage seems to corroborate.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_NFQUEUE: avoid double attempt at parsing
Jan Engelhardt [Tue, 24 May 2011 22:11:48 +0000 (00:11 +0200)] 
libxt_NFQUEUE: avoid double attempt at parsing

Fixes this error:

NFQUEUE: option "--queue-num" can only be used once.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: have xtopt_parse_mint interpret partially-spec'd ranges
Jan Engelhardt [Tue, 24 May 2011 21:50:29 +0000 (23:50 +0200)] 
libxtables: have xtopt_parse_mint interpret partially-spec'd ranges

When ":n" or "n:" is specified, it will now be interpreted as "0:n"
and "n:<max>", respecitvely. nvals will always reflect the number of
(expanded) components. This restores the functionality of options that
take such partially-unspecified ranges.

This makes it possible to nuke the per-matchdata init functions of
some extensions and simply the extensions postparsing to the point
where it only needs to check for nvals==1 or ==2.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: unclutter xtopt_parse_mint
Jan Engelhardt [Tue, 24 May 2011 12:49:15 +0000 (14:49 +0200)] 
libxtables: unclutter xtopt_parse_mint

..by moving type-based actions into their own function.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: make multiint parser have greater range
Jan Engelhardt [Tue, 24 May 2011 00:45:50 +0000 (02:45 +0200)] 
libxtables: make multiint parser have greater range

Since parse_mint can handle XTTYPE_UINT64RC, it must allow numbers
larger than UINT32_MAX.

Cc: JP Abgrall <jpa@google.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: use uintmax for xtables_strtoul
Jan Engelhardt [Tue, 24 May 2011 00:30:23 +0000 (02:30 +0200)] 
libxtables: use uintmax for xtables_strtoul

Addendum to 2305d5fb42fc059f38fc1bdf53411dbeecdb310b.

I noticed that unsigned long long is not consistently used, for
example, min/max are still just unsigned long, and strtoul is being
called.

Instead of changing it to unsigned long long, just use uintmax
functions right away so this does not need size-related changing in
the future.

Cc: JP Abgrall <jpa@google.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: more detailed error message on multi-int parsing
Jan Engelhardt [Tue, 24 May 2011 00:03:00 +0000 (02:03 +0200)] 
libxtables: more detailed error message on multi-int parsing

Now shows where exactly the error is.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibip6t_rt: restore --rt-type storing
Jan Engelhardt [Mon, 23 May 2011 22:45:08 +0000 (00:45 +0200)] 
libip6t_rt: restore --rt-type storing

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_u32: --u32 option is required
Jan Engelhardt [Mon, 23 May 2011 22:35:00 +0000 (00:35 +0200)] 
libxt_u32: --u32 option is required

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_ipvs: restore network-byte order
Jan Engelhardt [Sun, 22 May 2011 22:22:27 +0000 (00:22 +0200)] 
libxt_ipvs: restore network-byte order

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: remove redundant .IP calls in libxt_time
Jan Engelhardt [Mon, 23 May 2011 15:55:29 +0000 (17:55 +0200)] 
doc: remove redundant .IP calls in libxt_time

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: use .IP list for TCPMSS
Jan Engelhardt [Mon, 23 May 2011 15:54:38 +0000 (17:54 +0200)] 
doc: use .IP list for TCPMSS

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_devgroup: actually set XT_DEVGROUP_OPT_???GROUP flags
Lutz Jaenicke [Mon, 23 May 2011 14:28:25 +0000 (16:28 +0200)] 
libxt_devgroup: actually set XT_DEVGROUP_OPT_???GROUP flags

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agodoc: clarify that -p all is a special keyword only
Jan Engelhardt [Fri, 20 May 2011 22:58:44 +0000 (00:58 +0200)] 
doc: clarify that -p all is a special keyword only

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: make usage of libxt_rateest more obvious
Jan Engelhardt [Tue, 17 May 2011 13:17:08 +0000 (15:17 +0200)] 
doc: make usage of libxt_rateest more obvious

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: add some coded option examples to libxt_hashlimit
Jan Engelhardt [Fri, 20 May 2011 22:59:11 +0000 (00:59 +0200)] 
doc: add some coded option examples to libxt_hashlimit

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_rateest: streamline case display of units
Jan Engelhardt [Thu, 12 May 2011 15:36:25 +0000 (17:36 +0200)] 
libxt_rateest: streamline case display of units

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: check for negative numbers in xtables_strtou*
Jan Engelhardt [Fri, 20 May 2011 14:26:04 +0000 (16:26 +0200)] 
libxtables: check for negative numbers in xtables_strtou*

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_quota: make sure uint64 is not truncated
JP Abgrall [Thu, 19 May 2011 03:26:14 +0000 (20:26 -0700)] 
libxt_quota: make sure uint64 is not truncated

The xtables_strtoul() would cram a long long into a long.
The parse_int would try to cram a UINT64 into a long.

14 years agolibxt_quota: readd missing XTOPT_PUT request
Jan Engelhardt [Fri, 20 May 2011 14:01:18 +0000 (16:01 +0200)] 
libxt_quota: readd missing XTOPT_PUT request

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibipt_REDIRECT: "--to-ports" is not mandatory
Lutz Jaenicke [Wed, 18 May 2011 13:11:47 +0000 (15:11 +0200)] 
libipt_REDIRECT: "--to-ports" is not mandatory

The REDIRECT target can be called without the --to-ports option
being specified. From the manual page:
  ...without this, the destination port is never altered.

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: retract _NE types and use a flag instead
Jan Engelhardt [Wed, 18 May 2011 20:48:51 +0000 (22:48 +0200)] 
libxtables: retract _NE types and use a flag instead

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibip6t_rt: rt-0-not-strict should take no arg
Jan Engelhardt [Thu, 12 May 2011 23:53:07 +0000 (01:53 +0200)] 
libip6t_rt: rt-0-not-strict should take no arg

This unfortunately got mixed up during the getopt -> guided parser
move.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_conntrack: resolve erroneous rev-2 port range message
Jan Engelhardt [Thu, 12 May 2011 23:13:35 +0000 (01:13 +0200)] 
libxt_conntrack: resolve erroneous rev-2 port range message

  --ctorigdstport 13
ip6tables-restore v1.4.10: conntrack rev 2 does not support port ranges

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_conntrack: fix assignment to wrong member
Jan Engelhardt [Thu, 12 May 2011 23:12:05 +0000 (01:12 +0200)] 
libxt_conntrack: fix assignment to wrong member

Of course the range end ought to be set, not doing the start value
twice.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_conntrack: correct printed module name
Jan Engelhardt [Thu, 12 May 2011 23:06:31 +0000 (01:06 +0200)] 
libxt_conntrack: correct printed module name

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibipt_[SD]NAT: avoid false error about multiple destinations specified
Jan Engelhardt [Thu, 12 May 2011 22:15:45 +0000 (00:15 +0200)] 
libipt_[SD]NAT: avoid false error about multiple destinations specified

iptables-restore v1.4.10: DNAT: Multiple --to-destination not supported

xtables_option_parse sets cb->xflags already, so that it cannot be
directly used to test whether an option is being used for the second
time. Thus use a private option/flag (X_TO_DEST/SRC) that is not under
the control of xtables_option_parse.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibipt_[SD]NAT: flag up module name on error
Jan Engelhardt [Thu, 12 May 2011 22:11:00 +0000 (00:11 +0200)] 
libipt_[SD]NAT: flag up module name on error

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: collapse double protocol parsing
Jan Engelhardt [Thu, 12 May 2011 12:03:36 +0000 (14:03 +0200)] 
libxtables: collapse double protocol parsing

Un-dent xtables_parse_protocol, and make xtopt_parse_protocol make use
of it.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_policy: use XTTYPE_PROTOCOL type
Jan Engelhardt [Thu, 12 May 2011 11:59:38 +0000 (13:59 +0200)] 
libxt_policy: use XTTYPE_PROTOCOL type

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxtables: avoid running into .also checks when option not used
Jan Engelhardt [Thu, 12 May 2011 11:20:00 +0000 (13:20 +0200)] 
libxtables: avoid running into .also checks when option not used

If a particular option was not specified, it should not be subject to
.also checks in xtables_option_fcheck2 either.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibxt_policy: option table fixes, improved error tracking
Jan Engelhardt [Thu, 12 May 2011 10:46:40 +0000 (12:46 +0200)] 
libxt_policy: option table fixes, improved error tracking

Most of the flags are multi-use in this extension. Also transfer
--next => --strict requirement to option table.

Furthermore, augment the error messages emitted from fcheck to contain
the policy element number, and elaborate on what an "empty policy
element" is.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agosrc: combine default_command functions
Jan Engelhardt [Thu, 12 May 2011 10:21:59 +0000 (12:21 +0200)] 
src: combine default_command functions

14 years agosrc: replace old IP*T_ALIGN macros
Jan Engelhardt [Mon, 9 May 2011 17:32:05 +0000 (19:32 +0200)] 
src: replace old IP*T_ALIGN macros

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoMerge branch 'floating/opts' of git://dev.medozas.de/iptables
Patrick McHardy [Thu, 12 May 2011 09:11:51 +0000 (11:11 +0200)] 
Merge branch 'floating/opts' of git://dev.medozas.de/iptables

14 years agoMerge branch 'opts' of git://dev.medozas.de/iptables
Patrick McHardy [Wed, 11 May 2011 11:43:44 +0000 (13:43 +0200)] 
Merge branch 'opts' of git://dev.medozas.de/iptables

14 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Wed, 11 May 2011 11:43:04 +0000 (13:43 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

14 years agoMerge branch 'opts' of git://dev.medozas.de/iptables
Patrick McHardy [Mon, 9 May 2011 18:23:21 +0000 (20:23 +0200)] 
Merge branch 'opts' of git://dev.medozas.de/iptables

14 years agolibipt_SAME: use guided option parser
Jan Engelhardt [Mon, 9 May 2011 00:29:02 +0000 (02:29 +0200)] 
libipt_SAME: use guided option parser

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibipt_REDIRECT: use guided option parser
Jan Engelhardt [Sun, 8 May 2011 23:10:30 +0000 (01:10 +0200)] 
libipt_REDIRECT: use guided option parser

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agolibipt_MASQUERADE: use guided option parser
Jan Engelhardt [Sun, 8 May 2011 17:46:17 +0000 (19:46 +0200)] 
libipt_MASQUERADE: use guided option parser

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