]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
14 years agoiptables: limit chain name length to be consistent with targets
Jan Engelhardt [Mon, 13 Sep 2010 13:45:15 +0000 (15:45 +0200)] 
iptables: limit chain name length to be consistent with targets

Creationg of chain names longer than the ones being able to jump to
should be inhibited for consistency.

References: http://marc.info/?l=netfilter-devel&m=128397022618316&w=2
Cc: Stig Thormodsrud <stig@vyatta.com>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoiptables-xml: resolve compiler warnings
Jan Engelhardt [Mon, 13 Sep 2010 13:35:18 +0000 (15:35 +0200)] 
iptables-xml: resolve compiler warnings

iptables-xml.c: In function "parse_counters":
iptables-xml.c:70:8: warning: assignment from incompatible pointer type
iptables-xml.c:71:8: warning: assignment from incompatible pointer type

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agobuild: fix static linking
Jan Engelhardt [Tue, 3 Aug 2010 17:58:38 +0000 (19:58 +0200)] 
build: fix static linking

Gabor Z. Papp noted this link-time error when configuring with
--enable-static:

extensions/libext4.a(initext4.o): In function "init_extensions":
extensions/initext4.c:144: undefined reference to "libxt_IDLETIMER_init"
extensions/initext4.c:145: undefined reference to "libxt_TEE_init"

Indeed, since the two modules did not use our special macro "_init"
(which expands to libxt_foo_init), initext4.c could not find them by
that name. Correct this.

References: http://marc.info/?l=netfilter&m=128085480927924&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoxtables: remove unnecessary cast
Jan Engelhardt [Sun, 25 Jul 2010 21:36:17 +0000 (23:36 +0200)] 
xtables: remove unnecessary cast

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoMerge branch 'iptables-next'
Patrick McHardy [Tue, 3 Aug 2010 15:21:18 +0000 (17:21 +0200)] 
Merge branch 'iptables-next'

14 years agoBump version to 1.4.9 v1.4.9
Patrick McHardy [Tue, 3 Aug 2010 14:54:25 +0000 (16:54 +0200)] 
Bump version to 1.4.9

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agolibxt_quota: don't ignore the quota value on deletion
Changli Gao [Mon, 2 Aug 2010 16:03:20 +0000 (18:03 +0200)] 
libxt_quota: don't ignore the quota value on deletion

Don't ignore the quota value on deletion, then we can remove a special
rule everytime.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agodoc: consistent use of markup
Jan Engelhardt [Fri, 23 Jul 2010 19:23:05 +0000 (21:23 +0200)] 
doc: consistent use of markup

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoall: consistent syntax use in struct option
Jan Engelhardt [Fri, 23 Jul 2010 19:16:14 +0000 (21:16 +0200)] 
all: consistent syntax use in struct option

Try to inhibit copypasting old stuff.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: minimal spelling updates to xt_cpu
Jan Engelhardt [Fri, 23 Jul 2010 17:38:46 +0000 (19:38 +0200)] 
doc: minimal spelling updates to xt_cpu

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: remove extra empty line from xt_cpu
Jan Engelhardt [Fri, 23 Jul 2010 17:38:30 +0000 (19:38 +0200)] 
doc: remove extra empty line from xt_cpu

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agodoc: let man(1) autoalign the text in xt_cpu
Jan Engelhardt [Fri, 23 Jul 2010 17:38:04 +0000 (19:38 +0200)] 
doc: let man(1) autoalign the text in xt_cpu

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoMerge branch 'master' into iptables-next
Patrick McHardy [Fri, 23 Jul 2010 14:16:11 +0000 (16:16 +0200)] 
Merge branch 'master' into iptables-next

14 years agoextension: add xt_cpu match
Eric Dumazet [Fri, 23 Jul 2010 14:15:14 +0000 (16:15 +0200)] 
extension: add xt_cpu match

Kernel 2.6.36 supports xt_cpu match

In some situations a CPU match permits a better spreading of
connections, or select targets only for a given cpu.

With Remote Packet Steering or multiqueue NIC and appropriate IRQ
affinities, we can distribute trafic on available cpus, per session.
(all RX packets for a given flow are handled by a given cpu)

Some legacy applications being not SMP friendly, one way to scale a
server is to run multiple copies of them.

Instead of randomly choosing an instance, we can use the cpu number as a
key so that softirq handler for a whole instance is running on a single
cpu, maximizing cache effects in TCP/UDP stacks.

Using NAT for example, a four ways machine might run four copies of
server application, using a separate listening port for each instance,
but still presenting an unique external port :

iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 0 \
        -j REDIRECT --to-port 8080

iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 1 \
        -j REDIRECT --to-port 8081

iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 2 \
        -j REDIRECT --to-port 8082

iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 3 \
        -j REDIRECT --to-port 8083

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoextensions: REDIRECT: add random help
Eric Dumazet [Fri, 23 Jul 2010 10:54:37 +0000 (12:54 +0200)] 
extensions: REDIRECT: add random help

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoextensions: REDIRECT: add random help
Eric Dumazet [Fri, 23 Jul 2010 10:54:05 +0000 (12:54 +0200)] 
extensions: REDIRECT: add random help

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agolibxt_ipvs: user-space lib for netfilter matcher xt_ipvs
Hannes Eder [Fri, 23 Jul 2010 10:51:26 +0000 (12:51 +0200)] 
libxt_ipvs: user-space lib for netfilter matcher xt_ipvs

The user-space library for the netfilter matcher xt_ipvs.

[ trivial up-port by Simon Horman <horms@verge.net.au> ]
Signed-off-by: Hannes Eder <heder@google.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoMerge branch 'master' into iptables-next
Patrick McHardy [Thu, 15 Jul 2010 16:15:03 +0000 (18:15 +0200)] 
Merge branch 'master' into iptables-next

14 years agoextensions: fix compilation of the new CHECKSUM target
Patrick McHardy [Thu, 15 Jul 2010 16:12:49 +0000 (18:12 +0200)] 
extensions: fix compilation of the new CHECKSUM target

Add missing header file.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoextensions: libxt_rateest: fix bps options for iptables-save
Luciano Coelho [Thu, 15 Jul 2010 16:09:54 +0000 (18:09 +0200)] 
extensions: libxt_rateest: fix bps options for iptables-save

The output generated by the libxt_rateest extension for bps matches
was wrong and could not be restored properly.  This patch fixes this
problem by using the correct options in the right order when saving
the table.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoextensions: libxt_CHECKSUM extension
Michael S. Tsirkin [Thu, 15 Jul 2010 15:23:24 +0000 (17:23 +0200)] 
extensions: libxt_CHECKSUM extension

This adds a `CHECKSUM' target, which can be used in the iptables mangle
table.

You can use this target to compute and fill in the checksum in
a packet that lacks a checksum.  This is particularly useful,
if you need to work around old applications such as dhcp clients,
that do not work well with checksum offloads, but don't want to disable
checksum offload in your device.

The problem happens in the field with virtualized applications.
For reference, see Red Hat bz 605555, as well as
http://www.spinics.net/lists/kvm/msg37660.html

Typical expected use (helps old dhclient binary running in a VM):
iptables -A POSTROUTING -t mangle -p udp --dport bootpc \
-j CHECKSUM --checksum-fill

Includes fixes by Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoextensions: libxt_IDLETIMER: use xtables_param_act when checking options
Luciano Coelho [Thu, 15 Jul 2010 15:12:56 +0000 (17:12 +0200)] 
extensions: libxt_IDLETIMER: use xtables_param_act when checking options

This patch changes custom error messages for illegal options into the
default iptables messages, by using xtables_param_act().

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoxt_quota: also document negation
Jan Engelhardt [Fri, 2 Jul 2010 10:19:18 +0000 (12:19 +0200)] 
xt_quota: also document negation

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoextensions: libxt_quota.c: Support option negation
Samuel Ortiz [Fri, 2 Jul 2010 07:57:09 +0000 (09:57 +0200)] 
extensions: libxt_quota.c: Support option negation

The xt_quota_info flags should be set properly for the --quota option negation
support.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoextensions: libxt_rateest: fix typo in the man page
Luciano Coelho [Fri, 2 Jul 2010 07:36:37 +0000 (09:36 +0200)] 
extensions: libxt_rateest: fix typo in the man page

There were a few typos in some options in the rateest match section of the
man page: --rateest1-bps should be --rateest-bps1 and so on.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoextensions: libipt_LOG/libip6t_LOG: support macdecode option
Patrick McHardy [Mon, 28 Jun 2010 12:51:35 +0000 (14:51 +0200)] 
extensions: libipt_LOG/libip6t_LOG: support macdecode option

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoMerge branch 'master' of vishnu.netfilter.org:/data/git/iptables
Patrick McHardy [Fri, 25 Jun 2010 12:50:53 +0000 (14:50 +0200)] 
Merge branch 'master' of vishnu.netfilter.org:/data/git/iptables

15 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Fri, 25 Jun 2010 12:50:03 +0000 (14:50 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

15 years agolibxt_conntrack: do print netmask
Jan Engelhardt [Thu, 24 Jun 2010 19:23:44 +0000 (21:23 +0200)] 
libxt_conntrack: do print netmask

References: http://bugzilla.netfilter.org/show_bug.cgi?id=659
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibxt_hashlimit: always print burst value
Jan Engelhardt [Thu, 24 Jun 2010 19:13:47 +0000 (21:13 +0200)] 
libxt_hashlimit: always print burst value

iptables -L lists the burst value, and so should iptables -S. I was
certainly surprised to see it gone even when explicitly specifying
--hashlimit-burst 5 on the command line.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Thu, 24 Jun 2010 15:00:23 +0000 (17:00 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables

15 years agolibxt_set: new revision added
Jozsef Kadlecsik [Wed, 16 Jun 2010 10:45:33 +0000 (12:45 +0200)] 
libxt_set: new revision added

libipt_set renamed to libxt_set and the support for the forthcoming
ipset release added. I have tested backward (IPv4) and forward
compatibility (IPv4/IPv6):

ipset -N test iphash
ipset -A test test-address
iptables -N test-set
iptables -A test-set -j LOG --log-prefix "match "
iptables -A test-set -j DROP
iptables -A OUTPUT -m set --match-set test dst -j test-set
ping test-address

15 years agoextensions: add idletimer xt target extension
Luciano Coelho [Tue, 15 Jun 2010 14:54:50 +0000 (16:54 +0200)] 
extensions: add idletimer xt target extension

Add the extension plugin for the IDLETIMER x_tables target.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoxt_sctp: support FORWARD_TSN chunk type
Shan Wei [Tue, 8 Jun 2010 12:16:57 +0000 (14:16 +0200)] 
xt_sctp: support FORWARD_TSN chunk type

The latest kernel has implemented Partial Reliability Extension
that defined in RFC3758.

This patch adds FORWARD_TSN chunk for tracing.

Signed-off-by: Shan Wei<shanwei@cn.fujitsu.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoxt_sctp: Trace DATA chunk that supports SACK-IMMEDIATELY extension
Shan Wei [Tue, 8 Jun 2010 12:15:39 +0000 (14:15 +0200)] 
xt_sctp: Trace DATA chunk that supports SACK-IMMEDIATELY extension

SACK-IMMEDIATELY extension has defined in:
http://tools.ietf.org/html/draft-tuexen-tsvwg-sctp-sack-immediately-03.

And the latest kernel has added a I flag in DATA chunk to support this extension.
So let iptables/netfilter can trace it.

Signed-off-by: Shan Wei<shanwei@cn.fujitsu.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoxtables: remove xtables_set_revision function
Jan Engelhardt [Mon, 7 Jun 2010 10:00:24 +0000 (12:00 +0200)] 
xtables: remove xtables_set_revision function

Since iptables uses its own copies of the header files anyway where the
revision field is exposed, there is no reach to access name[] beyond its
size.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoxtables: another try at chain name length checking
Jan Engelhardt [Mon, 7 Jun 2010 09:50:25 +0000 (11:50 +0200)] 
xtables: another try at chain name length checking

Since XT_EXTENSION_MAXNAMELEN is now available, make use of it
and clear the confusion.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoincludes: sync header files from Linux 2.6.35-rc1
Jan Engelhardt [Mon, 7 Jun 2010 08:59:03 +0000 (10:59 +0200)] 
includes: sync header files from Linux 2.6.35-rc1

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: xt_LED: nroff formatting requirements
Jan Engelhardt [Fri, 4 Jun 2010 12:08:58 +0000 (14:08 +0200)] 
doc: xt_LED: nroff formatting requirements

Verbatim dashes need to be backslash-prefixed.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoextensions: add the LED target
Adam Nielsen [Sun, 4 Apr 2010 10:59:00 +0000 (12:59 +0200)] 
extensions: add the LED target

For the xt_LED target introduced in Linux 2.6.31.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: xt_hashlimit: fix a typo
Jan Engelhardt [Fri, 4 Jun 2010 11:05:58 +0000 (13:05 +0200)] 
doc: xt_hashlimit: fix a typo

References: http://bugzilla.netfilter.org/show_bug.cgi?id=646
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: xt_string: correct copy-and-pasting in manpage
Jan Engelhardt [Fri, 4 Jun 2010 10:51:24 +0000 (12:51 +0200)] 
doc: xt_string: correct copy-and-pasting in manpage

References: http://bugzilla.netfilter.org/show_bug.cgi?id=653
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoutils: add missing include flags to Makefile
Jan Engelhardt [Mon, 24 May 2010 05:47:59 +0000 (07:47 +0200)] 
utils: add missing include flags to Makefile

Fixes this compile error:

  CC     nfnl_osf.o
nfnl_osf.c:48:36: fatal error: linux/netfilter/xt_osf.h: No such file or directory
compilation terminated.

References: http://marc.info/?l=netfilter&m=127449929621579&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoRevert "Revert "Merge branch 'iptables-next'""
Patrick McHardy [Fri, 21 May 2010 10:57:23 +0000 (12:57 +0200)] 
Revert "Revert "Merge branch 'iptables-next'""

This reverts commit 110c1e4502e21ea38e0980e6f8af857d24330099.

Revert the revert to restore the TEE target.

15 years agoBump version to 1.4.8 v1.4.8
Patrick McHardy [Fri, 21 May 2010 10:48:13 +0000 (12:48 +0200)] 
Bump version to 1.4.8

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoRevert "Merge branch 'iptables-next'"
Patrick McHardy [Fri, 21 May 2010 10:47:16 +0000 (12:47 +0200)] 
Revert "Merge branch 'iptables-next'"

This reverts commit 65414babaebcd403e9bf2c27d9d74adb369bf3aa, reversing
changes made to 7278461dfad72e2008585dd0bac0e889e5bba99e.

Forgot to commit the version increase.

15 years agoMerge branch 'iptables-next'
Patrick McHardy [Thu, 20 May 2010 15:11:30 +0000 (17:11 +0200)] 
Merge branch 'iptables-next'

15 years agoextensions: MASQUERADE: fix --to-ports parser
Dmitry V. Levin [Thu, 20 May 2010 14:00:48 +0000 (16:00 +0200)] 
extensions: MASQUERADE: fix --to-ports parser

Rewrite port range validator to use xtables_strtoui() and
xtables_param_act().  Original check failed to recognize
such port range errors as "1a-2" and "1-2a".
Also, original parser erroneously denied using port 0,
which is now allowed.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoxtables: fix compilation when debugging is enabled
Patrick McHardy [Thu, 20 May 2010 13:41:03 +0000 (15:41 +0200)] 
xtables: fix compilation when debugging is enabled

Reported by yang.xuhui@jfsys.com.

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoiptables: add noreturn attribute to exit_tryhelp()
Dmitry V. Levin [Fri, 14 May 2010 11:26:22 +0000 (13:26 +0200)] 
iptables: add noreturn attribute to exit_tryhelp()

Found by gcc -Wmissing-noreturn.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoextensions: REDIRECT: fix --to-ports parser
Dmitry V. Levin [Fri, 14 May 2010 11:24:51 +0000 (13:24 +0200)] 
extensions: REDIRECT: fix --to-ports parser

Rewrite port range validator to use xtables_strtoui() and
xtables_param_act().  Original check failed to recognize
several types of port range errors, including:
"-1", "-1a", "-1-a", "a-1", "1a-2", "1-2a", etc.
Also, original parser erroneously denied using port 0,
which is now allowed.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoMerge branch 'master' of git://dev.medozas.de/iptables into iptables-next
Patrick McHardy [Thu, 13 May 2010 13:43:38 +0000 (15:43 +0200)] 
Merge branch 'master' of git://dev.medozas.de/iptables into iptables-next

15 years agoiptables: optionally disable largefile support
Karl Hiramoto [Mon, 10 May 2010 15:50:41 +0000 (17:50 +0200)] 
iptables: optionally disable largefile support

Many toolchains for embedded systems don't have largefile support:

usr/include/features.h:383:4: error: #error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, uClibc was built without large file support enabled.
In file included from /build_armeb/staging_dir/usr/include/stdio.h:72,
                 from libiptc/libip4tc.c:18:
/build_armeb/staging_dir/usr/include/bits/uClibc_stdio.h:72:2: error: #error Sorry... uClibc was built without large file support!
In file included from libiptc/libip4tc.c:18:
/build_armeb/staging_dir/usr/include/stdio.h:83: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fpos_t'
In file included from libiptc/libip4tc.c:18:
/build_armeb/staging_dir/usr/include/stdio.h:709: error: expected declaration specifiers or '...' before 'fpos_t'
/build_armeb/staging_dir/usr/include/stdio.h:711: error: expected ';', ',' or ')' before '*' token

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agolibxt_conntrack: document --ctstate UNTRACKED
Simon Lodal [Sun, 9 May 2010 23:02:21 +0000 (01:02 +0200)] 
libxt_conntrack: document --ctstate UNTRACKED

Signed-off-by: Simon Lodal <simonl@parknet.dk>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoCT: fix --ctevents parsing
Pablo Neira Ayuso [Sun, 9 May 2010 19:47:33 +0000 (21:47 +0200)] 
CT: fix --ctevents parsing

This patch fixes the following problem:

# iptables -t raw -I PREROUTING -t raw -j CT --ctevents assured
iptables v1.4.7: Unknown event type "assured"
Try `iptables -h' or 'iptables --help' for more information.

However, `assured' is one of the supported arguments for --ctevents.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
15 years agoiprange: fix xt_iprange v0 parsing
Vincent Bernat [Wed, 21 Apr 2010 12:48:26 +0000 (14:48 +0200)] 
iprange: fix xt_iprange v0 parsing

iprange_parse() was incomplete and did not include parsed ranges into
ipt_iprange_info structure resulting in always adding range
0.0.0.0-0.0.0.0 in the kernel.

Moreover, when using --dst-range, error messages may display
--src-range instead. Fix this too.

Signed-off-by: Vincent Bernat <bernat@luffy.cx>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agolibxt_CT: print conntrack zone in ->print/->save
Patrick McHardy [Tue, 20 Apr 2010 12:26:47 +0000 (14:26 +0200)] 
libxt_CT: print conntrack zone in ->print/->save

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoextensions: add support for xt_TEE
Jan Engelhardt [Mon, 19 Apr 2010 12:47:11 +0000 (14:47 +0200)] 
extensions: add support for xt_TEE

xt_TEE is firstly included in Linux 2.6.35.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibxt_osf: import nfnl_osf program
Jan Engelhardt [Sat, 27 Mar 2010 11:48:55 +0000 (12:48 +0100)] 
libxt_osf: import nfnl_osf program

xt_osf is pretty useless without the actual fingerprint loader. Import
nfnl_osf-2009-06-07 and make it a part of the iptables distribution.

Cc: Evgeniy Polyakov <johnpol@2ka.mxt.ru>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: add manpage for libxt_osf
Jan Engelhardt [Sat, 27 Mar 2010 11:38:45 +0000 (12:38 +0100)] 
doc: add manpage for libxt_osf

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibxt_recent: add a missing space in output
Jan Engelhardt [Wed, 17 Mar 2010 19:20:02 +0000 (20:20 +0100)] 
libxt_recent: add a missing space in output

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: remove claim that TCPMSS is limited to mangle
Jan Engelhardt [Wed, 17 Mar 2010 14:43:46 +0000 (15:43 +0100)] 
doc: remove claim that TCPMSS is limited to mangle

There was no real restriction, and in fact, the kernel module never
had such a limitation in the last years.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agodoc: libxt_MARK: no longer restricted to mangle table
Jan Engelhardt [Tue, 16 Mar 2010 19:28:30 +0000 (20:28 +0100)] 
doc: libxt_MARK: no longer restricted to mangle table

MARK used to be limited to the mangle table, but there was no real
restriction.

References: http://marc.info/?l=netfilter-devel&m=126806510332668&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoiptables: correctly check for too-long chain/target/match names
Jan Engelhardt [Tue, 16 Mar 2010 15:49:21 +0000 (16:49 +0100)] 
iptables: correctly check for too-long chain/target/match names

* iptables-restore was not checking for chain name length
* iptables was not checking for match name length
* target length was checked against 32, not 29.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=641
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibxt_CT: add a manpage
Jan Engelhardt [Wed, 10 Mar 2010 23:49:48 +0000 (00:49 +0100)] 
libxt_CT: add a manpage

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agolibxt_comment: avoid use of IPv4-specific examples
Jan Engelhardt [Wed, 10 Mar 2010 23:24:14 +0000 (00:24 +0100)] 
libxt_comment: avoid use of IPv4-specific examples

Since libxt_comment.man is included in both iptables.8 and
ip6tables.8, we should probably try to create examples that do not
rely on either address family.

References: http://bugs.debian.org/572628
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
15 years agoextensions: add CT extension
Patrick McHardy [Mon, 8 Mar 2010 12:57:24 +0000 (13:57 +0100)] 
extensions: add CT extension

Signed-off-by: Patrick McHardy <kaber@trash.net>
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>