]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
16 years agoxtables: fix segfault if incorrect protocol name is used
Pablo Neira Ayuso [Tue, 12 May 2009 07:51:26 +0000 (09:51 +0200)] 
xtables: fix segfault if incorrect protocol name is used

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

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

With this patch:

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

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

This patch adds support for the cluster match to iptables.

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

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

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

This patch bumps iptables version to 1.4.3.2

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

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

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

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

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

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

Connect history to the tag.

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

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

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

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

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

This patch complements the previous one.

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

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

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

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

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

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

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

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

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

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

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

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

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

The link of iptables-save fails on:

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

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

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

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

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

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

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

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

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

Cleanup whitespaces while going through the code.

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

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

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

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

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

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

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

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

Based upon a patch by Soren Hansen.

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

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

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

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

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

Use explicit paragraph separator and conntrack(8).

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

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

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

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

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

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

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

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

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

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

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

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

Thanks to Stephen Hemminger for noticing.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoinclude: resynchronize headers with 2.6.29-rc5
Jan Engelhardt [Sat, 21 Feb 2009 03:42:32 +0000 (04:42 +0100)] 
include: resynchronize headers with 2.6.29-rc5

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_policy: use bounded strtoui
Jan Engelhardt [Sat, 21 Feb 2009 03:00:21 +0000 (04:00 +0100)] 
libxt_policy: use bounded strtoui

reqid and SPI can only have a value in the range 0..UINT32_MAX, not
the entire range of the "long" type. Also throw an error if the
incoming string does not look like a pure number.

"Replaces" commit 6db2ded2f22a7e78743c86af523b8430876582e9.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: remove unwanted/add needed includes for IPv4 exts
Jan Engelhardt [Sat, 21 Feb 2009 02:44:36 +0000 (03:44 +0100)] 
extensions: remove unwanted/add needed includes for IPv4 exts

Most touched files do not use anything from ip_tables.h, so
remove that #include. multiport instead, does need it (ipt_entry).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: remove unwanted/add needed includes for IPv6 exts
Jan Engelhardt [Sat, 21 Feb 2009 02:40:27 +0000 (03:40 +0100)] 
extensions: remove unwanted/add needed includes for IPv6 exts

Most touched files do not use anything from ip6_tables.h, so
remove that #include. multiport instead, does need it (ip6t_entry).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix exit_error to xtables_error
Jan Engelhardt [Sat, 21 Feb 2009 02:29:44 +0000 (03:29 +0100)] 
libxtables: prefix exit_error to xtables_error

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: inline and remove unused OPTION_OFFSET macro
Jan Engelhardt [Sat, 21 Feb 2009 01:48:11 +0000 (02:48 +0100)] 
libxtables: inline and remove unused OPTION_OFFSET macro

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agodoc: resynchronize manpage with in-code help
Jan Engelhardt [Fri, 20 Feb 2009 15:39:54 +0000 (16:39 +0100)] 
doc: resynchronize manpage with in-code help

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_policy: cannot set spi/reqid numbers higher than 0x7fffffff
Christian Perle [Tue, 17 Feb 2009 16:31:52 +0000 (17:31 +0100)] 
libxt_policy: cannot set spi/reqid numbers higher than 0x7fffffff

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

When using the -m policy match, the option argument for --spi is converted
using strtol(), which returns a signed 32 bit value, so the highest
positive value is 0x7fffffff. Instead strtoul() should be used.
The same applies for the --reqid option argument.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agodoc: do not put IPv4 doc into ip6tables.8
Jan Engelhardt [Tue, 17 Feb 2009 14:05:29 +0000 (15:05 +0100)] 
doc: do not put IPv4 doc into ip6tables.8

Reference: http://bugs.debian.org/515752
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: trigger reconfigure when extensions/GNUmakefile.in changes
Jan Engelhardt [Tue, 17 Feb 2009 14:04:57 +0000 (15:04 +0100)] 
build: trigger reconfigure when extensions/GNUmakefile.in changes

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibiptc: make library available as a shared library
Jan Engelhardt [Wed, 11 Feb 2009 15:40:29 +0000 (16:40 +0100)] 
libiptc: make library available as a shared library

Tested-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: general follow-up cleanup
Jamal Hadi Salim [Fri, 13 Feb 2009 15:42:24 +0000 (10:42 -0500)] 
libxtables: general follow-up cleanup

Kill program_name, program_version and xtables_program_name.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
16 years agolibxtables: consolidate init calls into one function
Jamal Hadi Salim [Fri, 13 Feb 2009 14:14:17 +0000 (09:14 -0500)] 
libxtables: consolidate init calls into one function

Introduce xtables_init_all() which hides three calls xtables_init(),
xtables_set_nfproto(), and xtables_set_params(). Make
ip[6]tables-restore, ip[6]tables-save and ip[6]tables-standalone use
it.

I moved xtables_set_params around for readability reasons.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
16 years agolibxtables: consolidate merge_options into xtables_merge_options
Jamal Hadi Salim [Fri, 13 Feb 2009 13:36:44 +0000 (08:36 -0500)] 
libxtables: consolidate merge_options into xtables_merge_options

Introduce xtables_merge_options() for re-use reasons. Apps can use it
instead of each defining their own merge_options(). Made iptables and
ip6tables use the new shared interface.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
16 years agobuild: remove unneeded -ldl from iptables_xml_LDADD
Jan Engelhardt [Thu, 12 Feb 2009 18:27:49 +0000 (19:27 +0100)] 
build: remove unneeded -ldl from iptables_xml_LDADD

Addendum to commit 5c3e0767764bb7fa1db61ac326e8359161380e21.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: make iptables and ip6tables use xtables_free_opts
Jamal Hadi Salim [Thu, 12 Feb 2009 16:43:01 +0000 (11:43 -0500)] 
libxtables: make iptables and ip6tables use xtables_free_opts

The patch modifies xtables_globals to introduce orig_opts and
xtables_free_opts() to emulate what free_opts used to do. We also get
rid of the copies of free_opts() that iptables and ip6tables keep.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
16 years agolibxtables: add xtables_set_revision
Jamal Hadi Salim [Thu, 12 Feb 2009 14:33:59 +0000 (09:33 -0500)] 
libxtables: add xtables_set_revision

Introduce xtables_set_revision() and make iptables and ip6tables use it.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
16 years agolibxtables: set names of programs
Jamal Hadi Salim [Wed, 11 Feb 2009 21:28:31 +0000 (16:28 -0500)] 
libxtables: set names of programs

Set proper name of application.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
16 years agolibipq: fix compile error
Jan Engelhardt [Thu, 12 Feb 2009 14:07:15 +0000 (15:07 +0100)] 
libipq: fix compile error

libipq.c: In function `ipq_create_handle':
libipq.c:220: error: `NFPROTO_IPV4' undeclared (first use in this function)
libipq.c:220: error: (Each undeclared identifier is reported only once
libipq.c:220: error: for each function it appears in.)
libipq.c:222: error: `NFPROTO_IPV6' undeclared (first use in this function)

Add the required includes.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: restructure Makefile for include/ directory
Jan Engelhardt [Thu, 12 Feb 2009 14:01:37 +0000 (15:01 +0100)] 
build: restructure Makefile for include/ directory

This patch will support adding libiptc to the headers list in future.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agodoc: fix one layout issue in iptables-restore.8
Shaul Karl [Mon, 19 Jan 2009 10:09:36 +0000 (02:09 -0800)] 
doc: fix one layout issue in iptables-restore.8

Reference: http://bugs.debian.org/512281
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agodoc: fix option typo in libxt_multiport
Marc Fournier [Thu, 15 Jan 2009 12:57:53 +0000 (13:57 +0100)] 
doc: fix option typo in libxt_multiport

Reference: http://bugs.debian.org/511891
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibipq: add missing doc for NF_ values
Jan Engelhardt [Thu, 12 Feb 2009 13:48:59 +0000 (14:48 +0100)] 
libipq: add missing doc for NF_ values

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: flush before fork
Jan Engelhardt [Thu, 12 Feb 2009 00:28:35 +0000 (01:28 +0100)] 
libxtables: flush before fork

Reference: http://bugs.debian.org/514869
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_string: fix undefined behavior/incorrect patlen calculation
Jan Engelhardt [Thu, 12 Feb 2009 00:18:35 +0000 (01:18 +0100)] 
libxt_string: fix undefined behavior/incorrect patlen calculation

strlen ran over the end of the string. Use strnlen to bound it.

Reference: http://bugs.debian.org/513516
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: use const for vars holding literals
Jan Engelhardt [Wed, 11 Feb 2009 15:13:47 +0000 (16:13 +0100)] 
libxtables: use const for vars holding literals

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Thu, 12 Feb 2009 06:09:55 +0000 (07:09 +0100)] 
Merge branch 'master' of git://dev.medozas.de/iptables

16 years agolibxtables: simple aliasing macro for exit_error
Jamal Hadi Salim [Wed, 11 Feb 2009 12:05:43 +0000 (13:05 +0100)] 
libxtables: simple aliasing macro for exit_error

Rename xtables_globals exit_error cb to exit_err and introduce
a very simple aliasing macro to point to it.
convert iptables, ip6tables and iptables_xml to use it.
Note iptables_xml does not have to define its own exit_error()
since it can use the basic one provided.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibxtables: Replace direct exit_error() calls inside libxtables
Jamal Hadi Salim [Wed, 11 Feb 2009 12:04:26 +0000 (13:04 +0100)] 
libxtables: Replace direct exit_error() calls inside libxtables

Replace direct exit_error() calls inside libxtables with
xt_params->exit_error().

With this change; i can now compile the useless app:
-----
 #include <xtables.h>
 int main(int argc, char **argv) {

        return 0;
 }
----

with "gcc useless.c -lxtables -ldl"

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibxtables: Make ip6tables, iptables and iptables-xml use xtables_globals
Jamal Hadi Salim [Wed, 11 Feb 2009 12:03:34 +0000 (13:03 +0100)] 
libxtables: Make ip6tables, iptables and iptables-xml use xtables_globals

convert ip6tables, iptables and iptables-xml to use
xtables_globals/xtables_set_params()

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibxtables: Add exit_error cb to xtables_globals
Jamal Hadi Salim [Wed, 11 Feb 2009 12:02:21 +0000 (13:02 +0100)] 
libxtables: Add exit_error cb to xtables_globals

Introduce exit_error() as part of xtables_globals structure.
When an application registers its xtables_globals definition
and does not specify its exit_error() it gets assigned a
basic version

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibxtables: define xtables_free_opts()
Jamal Hadi Salim [Wed, 11 Feb 2009 12:00:02 +0000 (13:00 +0100)] 
libxtables: define xtables_free_opts()

Introduce xtables_free_opts() an xtables variant of
free_opts() which uses xtables_globals already set
by xtables_set_params(). The end goal is to have all internal
references in xtables.c use xtables_free_opts() instead of
depending on external defined free_opts()

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibxtables: Introduce global params structuring
Jamal Hadi Salim [Wed, 11 Feb 2009 11:58:54 +0000 (12:58 +0100)] 
libxtables: Introduce global params structuring

introduce a new struct,xtables_globals, so as to
localize the globals used and help in symbol renames.
The applications must invoke xtables_set_params() before starting
to use any iptables APIs.
xtables_set_params() is intended to free xtables from depending
(as it does right now) on existence of such externally definitions
(from iptables/iptables6 etc). At the moment, xtables wont even
compile without presence of at least one of {iptables/iptables6 etc}

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agosrc: consolidate duplicate code in iptables/internal.h
Jan Engelhardt [Tue, 10 Feb 2009 09:51:25 +0000 (10:51 +0100)] 
src: consolidate duplicate code in iptables/internal.h

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: move compat defines to xtables.c
Jan Engelhardt [Tue, 10 Feb 2009 09:48:28 +0000 (10:48 +0100)] 
libxtables: move compat defines to xtables.c

Addendum to commit v1.4.3-rc1-41-g77f48c2 where the macro users
got moved.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agosrc: remove unused ipt_tryload macro
Jan Engelhardt [Tue, 10 Feb 2009 09:43:42 +0000 (10:43 +0100)] 
src: remove unused ipt_tryload macro

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agosrc: remove iptables_rule_match indirection macro
Jan Engelhardt [Tue, 10 Feb 2009 09:43:08 +0000 (10:43 +0100)] 
src: remove iptables_rule_match indirection macro

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: decouple non-xtables parts from header
Jan Engelhardt [Tue, 10 Feb 2009 09:40:15 +0000 (10:40 +0100)] 
libxtables: decouple non-xtables parts from header

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: remove unused XT_LIB_DIR macro
Jan Engelhardt [Tue, 10 Feb 2009 09:25:08 +0000 (10:25 +0100)] 
libxtables: remove unused XT_LIB_DIR macro

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agobuild: move -ldl to proper LDADD
Jan Engelhardt [Tue, 10 Feb 2009 09:20:19 +0000 (10:20 +0100)] 
build: move -ldl to proper LDADD

libxtables uses dlopen, so *it* has to use -ldl, not the main program.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: recognize IP6TABLES_LIB_DIR old-style environment variable
Jan Engelhardt [Tue, 10 Feb 2009 08:54:04 +0000 (09:54 +0100)] 
libxtables: recognize IP6TABLES_LIB_DIR old-style environment variable

Commit v1.4.3-rc1-47-g300e290 tried to consolidate the environment
variable presence checking code into xtables.c, but missed
adding IP6TABLES_LIB_DIR to libxtables.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoMerge branch 'master' of git://dev.medozas.de/iptables
Patrick McHardy [Mon, 9 Feb 2009 17:58:45 +0000 (18:58 +0100)] 
Merge branch 'master' of git://dev.medozas.de/iptables

16 years agoxt_NFLOG: Set default NFLOG qthreshold to 0
Eric Leblond [Mon, 9 Feb 2009 17:34:01 +0000 (18:34 +0100)] 
xt_NFLOG: Set default NFLOG qthreshold to 0

By setting default NFLOG qthreshold to 0, userspace does not overwrite
the per-instance value.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoMerge branch 'origin/master'
Jan Engelhardt [Sun, 8 Feb 2009 17:19:43 +0000 (18:19 +0100)] 
Merge branch 'origin/master'

(throw away remote three commits as they had been redone
in this local branch)

16 years agolibxtables: move afinfo around
Jan Engelhardt [Sat, 7 Feb 2009 18:59:53 +0000 (19:59 +0100)] 
libxtables: move afinfo around

libxtables should not rely on the program executable providing the
magic constants for using [gs]etsockopt.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix names and order #3
Jan Engelhardt [Sun, 1 Feb 2009 21:33:37 +0000 (22:33 +0100)] 
libxtables: prefix names and order #3

This change affects:
find_{match,target} -> xtables_find_{match,target}
enum xt_tryload -> enum xtables_tryload
loose flags like DONT_LOAD -> XTF_DONT_LOAD

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agolibxtables: prefix names and order it #2
Jan Engelhardt [Sun, 1 Feb 2009 21:32:56 +0000 (22:32 +0100)] 
libxtables: prefix names and order it #2

This change affects:
load_xtables_ko -> xtables_load_ko
modprobe_program -> xtables_modprobe_program
Now uses bool for the "quiet" flag.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agolibbxtables: prefix names and order it #1
Jan Engelhardt [Sun, 1 Feb 2009 20:38:14 +0000 (21:38 +0100)] 
libbxtables: prefix names and order it #1

It is good practice to prefix names in a library some way so that
it does not clash with external programs' variable names right
on the first try.

This change: rename fw_[cm]alloc to xtables_[cm]alloc and
move the definition from internal.h to xtables.h to avoid
potential compiler warnings.

These functions are intended to fix Jamal's dependency problem in
his tc's ipt action.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agolibxtables: prefix/order - move parse_protocol to xtables.c
Jan Engelhardt [Fri, 30 Jan 2009 04:38:11 +0000 (05:38 +0100)] 
libxtables: prefix/order - move parse_protocol to xtables.c

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - move check_inverse to xtables.c
Jan Engelhardt [Fri, 30 Jan 2009 03:55:38 +0000 (04:55 +0100)] 
libxtables: prefix/order - move check_inverse to xtables.c

This also adds a warning that intrapositional negation support
is deprecated.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix - parse and escaped output func
Jan Engelhardt [Fri, 30 Jan 2009 03:32:50 +0000 (04:32 +0100)] 
libxtables: prefix - parse and escaped output func

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix - misc functions
Jan Engelhardt [Fri, 30 Jan 2009 03:24:47 +0000 (04:24 +0100)] 
libxtables: prefix - misc functions

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - ascii to ipaddr/ipmask input
Jan Engelhardt [Fri, 30 Jan 2009 03:20:32 +0000 (04:20 +0100)] 
libxtables: prefix/order - ascii to ipaddr/ipmask input

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - ipaddr/ipmask to ascii output
Jan Engelhardt [Fri, 30 Jan 2009 02:55:09 +0000 (03:55 +0100)] 
libxtables: prefix/order - ipaddr/ipmask to ascii output

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - param_act
Jan Engelhardt [Tue, 27 Jan 2009 20:27:19 +0000 (21:27 +0100)] 
libxtables: prefix/order - param_act

Changes:
exittype -> xtables_exittype
P_* -> XTF_* flags

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - program_name
Jan Engelhardt [Tue, 27 Jan 2009 19:56:23 +0000 (20:56 +0100)] 
libxtables: prefix/order - program_name

Split XTABLES_VERSION into xtables and iptables, and encode the
xtables soversion into the extensions instead. This makes it possible
to upgrade iptables without having to recompile 3rd-party extensions
(if the libxtables version matches, of course).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - strtoui
Jan Engelhardt [Tue, 27 Jan 2009 17:43:01 +0000 (18:43 +0100)] 
libxtables: prefix/order - strtoui

This commit also throws out the redundant string_to_number_*.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - libdir
Jan Engelhardt [Tue, 27 Jan 2009 14:59:06 +0000 (15:59 +0100)] 
libxtables: prefix/order - libdir

Consolidate the libdir variable initialization code into xtables.c.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - match/target loading
Jan Engelhardt [Tue, 27 Jan 2009 14:23:01 +0000 (15:23 +0100)] 
libxtables: prefix/order - match/target loading

This change affects:
find_{match,target} -> xtables_find_{match,target}
enum xt_tryload -> enum xtables_tryload
loose flags like DONT_LOAD -> XTF_DONT_LOAD

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - modprobe and xtables.ko loading
Jan Engelhardt [Tue, 27 Jan 2009 14:10:05 +0000 (15:10 +0100)] 
libxtables: prefix/order - modprobe and xtables.ko loading

This change affects:
load_xtables_ko -> xtables_load_ko
modprobe_program -> xtables_modprobe_program
Now uses bool for the "quiet" flag.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxtables: prefix/order - fw_xalloc
Jan Engelhardt [Tue, 27 Jan 2009 13:58:41 +0000 (14:58 +0100)] 
libxtables: prefix/order - fw_xalloc

It is good practice to prefix names in a library some way so that
it does not clash with external programs' variable names right
on the first try.

This change: rename fw_[cm]alloc to xtables_[cm]alloc and
move the definition from internal.h to xtables.h to avoid
potential compiler warnings.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoextensions: use UINT_MAX constants over open-coded numbers (2/2)
Jan Engelhardt [Tue, 27 Jan 2009 17:14:21 +0000 (18:14 +0100)] 
extensions: use UINT_MAX constants over open-coded numbers (2/2)

Use the handy constants for ranges.

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