]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
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 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>
16 years agoextensions: use UINT_MAX constants over open-coded bits (1/2)
Jan Engelhardt [Tue, 27 Jan 2009 16:39:01 +0000 (17:39 +0100)] 
extensions: use UINT_MAX constants over open-coded bits (1/2)

~0 depends on the sizeof(int), so it is better to use UINT32_MAX.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agolibxt_owner: use correct UID/GID boundaries
Jan Engelhardt [Tue, 27 Jan 2009 16:34:58 +0000 (17:34 +0100)] 
libxt_owner: use correct UID/GID boundaries

-1 is a reserved number (chown uses it to denote "do not change"),
so the maximum libxt_owner should permit is up to UINT32_MAX-1.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agosrc: remove redundant casts
Jan Engelhardt [Tue, 27 Jan 2009 16:24:34 +0000 (17:24 +0100)] 
src: remove redundant casts

All of them are implicitly convertable without any wanted side effects.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agosrc: remove redundant returns at end of void-returning functions
Jan Engelhardt [Tue, 27 Jan 2009 16:16:26 +0000 (17:16 +0100)] 
src: remove redundant returns at end of void-returning functions

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agoman: fix physdev manpage
Bart De Schuymer [Mon, 26 Jan 2009 15:31:51 +0000 (16:31 +0100)] 
man: fix physdev manpage

A sentence of the physdev module's help entry was truncated by the man
program because the line starts with a single quote.

Signed-off-by: Bart De Schuymer <bdschuym@pandora.be>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibxt_owner: add more spaces to output
Daniel Drake [Mon, 19 Jan 2009 14:36:41 +0000 (15:36 +0100)] 
libxt_owner: add more spaces to output

Commit bb9284d1 ("libxt_owner: add spaces to output") moved the printing
of spaces away from the owner_mt_print() function family, but forgot to
add spaces in all of the print_item() functions that are called.

This is likely to be at least the partial cause of
https://bugs.gentoo.org/show_bug.cgi?id=254435

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Approves-of-this-patch: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agodoc: augment ICMP manpage by type/code syntax
Jan Engelhardt [Tue, 13 Jan 2009 14:30:10 +0000 (15:30 +0100)] 
doc: augment ICMP manpage by type/code syntax

The ICMP match module also allows numeric type/code as in
"--icmp-type type/code". Document it.

Based upon a patch by Victor Stinner <vstinner@inl.fr>.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
16 years agodoc: escape minus sign in manpage (2)
Jan Engelhardt [Mon, 12 Jan 2009 06:06:12 +0000 (07:06 +0100)] 
doc: escape minus sign in manpage (2)

Addendum to previous patch.

16 years agobuild: remove non-portable rule
Jan Engelhardt [Mon, 12 Jan 2009 06:22:18 +0000 (07:22 +0100)] 
build: remove non-portable rule

> Makefile.am:97: `%'-style pattern rules are a GNU make extension

(iptables still requires GNU make for extensions/, because it is
so much easier to write.)

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agobuild: use regular = assignments in Makefile
Jan Engelhardt [Mon, 12 Jan 2009 06:21:20 +0000 (07:21 +0100)] 
build: use regular = assignments in Makefile

Resolves warnings:
Makefile.am:7: `:='-style assignments are not portable
Makefile.am:71: `:='-style assignments are not portable
etc.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agodoc: escape minus sign in manpages
Jan Engelhardt [Mon, 12 Jan 2009 03:53:18 +0000 (04:53 +0100)] 
doc: escape minus sign in manpages

groff formats '-' as a hyphen, and '\-' is needed for a minus.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agodoc: resynchronize markup in iptables,ip6tables.8.in
Jan Engelhardt [Thu, 8 Jan 2009 17:04:40 +0000 (18:04 +0100)] 
doc: resynchronize markup in iptables,ip6tables.8.in

Change .br to .PP in the intro section and use consistent
paragraphing in later ones.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agodoc: put iptables version into manpage
Jan Engelhardt [Thu, 8 Jan 2009 17:03:45 +0000 (18:03 +0100)] 
doc: put iptables version into manpage

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agobuild: resolve autotools suggestions
Jan Engelhardt [Wed, 7 Jan 2009 14:11:59 +0000 (15:11 +0100)] 
build: resolve autotools suggestions

libtool2 wants to put files into m4, so let it have it.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoenv: augment deprecation notice
Jan Engelhardt [Wed, 7 Jan 2009 13:43:47 +0000 (14:43 +0100)] 
env: augment deprecation notice

Tell the user what to use instead of IP*TABLES_LIBDIR.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agorateest: guard against segfault
Jan Engelhardt [Tue, 30 Dec 2008 11:03:39 +0000 (12:03 +0100)] 
rateest: guard against segfault

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoiptables-save: output ! in position according to manpage
Jan Engelhardt [Tue, 9 Dec 2008 14:06:20 +0000 (15:06 +0100)] 
iptables-save: output ! in position according to manpage

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agosrc: remove unused include files
Jan Engelhardt [Sun, 7 Dec 2008 15:54:06 +0000 (16:54 +0100)] 
src: remove unused include files

No .c files include any of these - in fact they seem to be remnants
missed during commit b1f568309a09e61f892dee3c23279cecff0b0ff4 -
so remove them.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: guard chain index allocation for different malloc implementations
Jan Engelhardt [Wed, 26 Nov 2008 16:18:08 +0000 (17:18 +0100)] 
libiptc: guard chain index allocation for different malloc implementations

Some libc implementations such as µClibc return NULL on malloc(0).
They are free to do that per C standard.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signeed-off-by: Patrick McHardy <kaber@trash.net>
16 years agodoc: fix a typo in libip6t_REJECT.man
Jan Engelhardt [Mon, 24 Nov 2008 12:52:30 +0000 (13:52 +0100)] 
doc: fix a typo in libip6t_REJECT.man

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agosrc: remove inclusion of iptables.h
Jan Engelhardt [Thu, 20 Nov 2008 09:15:35 +0000 (10:15 +0100)] 
src: remove inclusion of iptables.h

iptables.h and ip6tables.h only include declarations internal to
iptables (specifically iptables.c and ip6tables.c), as most of the
public API has been moved to xtables.h a few months ago.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoiptables: refer to dmesg when we hit error
Pablo Neira Ayuso [Wed, 19 Nov 2008 18:01:26 +0000 (19:01 +0100)] 
iptables: refer to dmesg when we hit error

This does not make any better, but at least refer to
dmesg which is the common source of information to diagnose
kernel-side problems. This is helpful for newbie users.

# iptables -I INPUT -j CLUSTERIP
iptables: Invalid argument. Run `dmesg' for more information.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agostate: report spaces in the state list parsing
Pablo Neira Ayuso [Wed, 19 Nov 2008 18:01:26 +0000 (19:01 +0100)] 
state: report spaces in the state list parsing

This patch adds better error reporting when the user inserts a space
between two states with the --state option.

iptables -I INPUT -m state ESTABLISHED, RELATED
                                       ^
  mind the space

results in:

iptables v1.4.2-rc1: Bad state `'
Try `iptables -h' or 'iptables --help' for more information.

Now this returns:

iptables v1.4.2-rc1: `--state' requires a list of states with no
spaces, e.g. ESTABLISHED,RELATED

This patch also applies to libxt_conntrack which has a copy of the
function.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agoiptables: fix error reporting with wrong/missing arguments
Pablo Neira Ayuso [Wed, 19 Nov 2008 18:01:26 +0000 (19:01 +0100)] 
iptables: fix error reporting with wrong/missing arguments

This patch fixes wrong error reporting when arguments are missing:

# iptables -I INPUT -m state --state
iptables v1.4.2-rc1: Unknown arg `(null)'
Try `iptables -h' or 'iptables --help' for more information.

or wrong:

# iptables -I INPUT -m state --xyz
iptables v1.4.2-rc1: Unknown arg `(null)'
Try `iptables -h' or 'iptables --help' for more information.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 years agosrc: use NFPROTO_ constants
Jan Engelhardt [Tue, 18 Nov 2008 11:27:54 +0000 (12:27 +0100)] 
src: use NFPROTO_ constants

Resync netfilter.h from the latest kernel and make use of the new
NFPROTO_ constants that have been introduced.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agosrc: reuse the global modprobe_program variable
Jan Engelhardt [Tue, 18 Nov 2008 11:26:26 +0000 (12:26 +0100)] 
src: reuse the global modprobe_program variable

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoBump version to 1.4.3-rc1 v1.4.3-rc1
Patrick McHardy [Thu, 13 Nov 2008 15:38:01 +0000 (16:38 +0100)] 
Bump version to 1.4.3-rc1

16 years agolibxt_conntrack: dump ctdir
Jan Engelhardt [Wed, 12 Nov 2008 11:03:25 +0000 (12:03 +0100)] 
libxt_conntrack: dump ctdir

Sent in as part of a larger private mail by Gáspár Lajos
<swifty@freemail.hu>; I cherry-picked the ctdir part.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: make sockfd a per-handle thing
Jan Engelhardt [Mon, 10 Nov 2008 16:25:55 +0000 (17:25 +0100)] 
libiptc: make sockfd a per-handle thing

Get away from this singleton.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibxt_conntrack: respect -n option during ruledump
Jan Engelhardt [Mon, 10 Nov 2008 16:08:07 +0000 (17:08 +0100)] 
libxt_conntrack: respect -n option during ruledump

Reference: http://bugs.debian.org/502548

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: use hex output for hookmask
Jan Engelhardt [Mon, 10 Nov 2008 16:07:31 +0000 (17:07 +0100)] 
libiptc: use hex output for hookmask

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: remove unused iptc_get_raw_socket and iptc_check_packet
Jan Engelhardt [Mon, 10 Nov 2008 16:01:24 +0000 (17:01 +0100)] 
libiptc: remove unused iptc_get_raw_socket and iptc_check_packet

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: remove indirections
Jan Engelhardt [Mon, 10 Nov 2008 16:00:41 +0000 (17:00 +0100)] 
libiptc: remove indirections

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibiptc: remove typedef indirection
Jan Engelhardt [Mon, 10 Nov 2008 15:59:27 +0000 (16:59 +0100)] 
libiptc: remove typedef indirection

Don't you hate it when iptc_handle_t *x actually is a double-indirection
struct iptc_handle **? This also shows the broken constness model, since
"const iptc_handle_t x" = "iptc_handle_t const x" =
"struct iptc_handle *const x", which is like no const at all.
Lots of things to do then.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoAdd SCTP/DCCP support to NAT targets
Patrick McHardy [Tue, 4 Nov 2008 12:22:40 +0000 (13:22 +0100)] 
Add SCTP/DCCP support to NAT targets

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agomanpage: explain what rule-specification is
Jan Engelhardt [Wed, 29 Oct 2008 08:48:59 +0000 (09:48 +0100)] 
manpage: explain what rule-specification is

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>