]> git.ipfire.org Git - thirdparty/iptables.git/log
thirdparty/iptables.git
17 years agolibxt_owner: add spaces to output
Jan Engelhardt [Fri, 6 Jun 2008 12:20:05 +0000 (14:20 +0200)] 
libxt_owner: add spaces to output

It could happen that --<arg><value> was printed on iptables-save with
owner rules (owner_mt_save() function) without the obligatory space
inbetween. Also transfer printing of the space character into
owner_mt_print_item().

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoaddrtype match: added revision 1
Laszlo Attila Toth [Fri, 6 Jun 2008 12:17:53 +0000 (14:17 +0200)] 
addrtype match: added revision 1

In revision 1 address type checking can be limited to either the
incoming or outgoing interface depending on the current chain. In
the FORWARD chain only one of them is allowed at the same time.

Signed-off-by: Laszlo Attila Toth <panther@balabit.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoFix iptables-save output of libxt_owner match
Lutz Jaenicke [Fri, 6 Jun 2008 12:01:05 +0000 (14:01 +0200)] 
Fix iptables-save output of libxt_owner match

The _save functions need to use the same syntax that is used for parsing
the input instead of "user readable" output.

17 years agoBump version v1.4.1-rc3
Patrick McHardy [Fri, 6 Jun 2008 11:17:13 +0000 (13:17 +0200)] 
Bump version

17 years agobuild: check for missing feature files
Jan Engelhardt [Thu, 5 Jun 2008 17:54:48 +0000 (19:54 +0200)] 
build: check for missing feature files

linux/dccp.h is unlikely to be installed before 2.6.18 (which was
when headers_install was introduced), and does not exist at all
before 2.6.14. Add a compile-time check to skip compilation of
libxt_dccp in case this was detected.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoUpdate .gitignore
Jan Engelhardt [Thu, 5 Jun 2008 15:10:59 +0000 (17:10 +0200)] 
Update .gitignore

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoResync header files with kernel
Patrick McHardy [Thu, 5 Jun 2008 14:18:41 +0000 (16:18 +0200)] 
Resync header files with kernel

Resync headers and add types.h file for endian annotated types, which
are not available with old headers.

17 years agoUse s6_addr32 to access bits in int6_addr instead of incompatible name
Yasuyuki Kozakai [Wed, 4 Jun 2008 13:16:03 +0000 (15:16 +0200)] 
Use s6_addr32 to access bits in int6_addr instead of incompatible name

Spotted by Khem Raj <raj.khem@gmail.com>

Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoAdd xtables version defines.
Thomas Jarosch [Tue, 3 Jun 2008 13:02:18 +0000 (15:02 +0200)] 
Add xtables version defines.

Attached is a patch to add the new defines. The macro XTABLES_VERSION
is already in use, so I named it XTABLES_VERSION_CHECK. I've also tested
that an empty XTABLES_VERSION_EXTRA in configure.ac works.

Now we can write code like this:

    #warning You are obselete and will be assimilated.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agomanpages: consistent syntax
Patrick McHardy [Mon, 2 Jun 2008 10:48:48 +0000 (12:48 +0200)] 
manpages: consistent syntax

In the manpages, bold is used to denote characters the user has to
enter verbatim, italic denotes placeholders and non-highlighted
pieces are used as a structure: "[]" specifying an optional part,
"{}" a mandatory part, with "|" used for alternations. The "!" for
negation is better supported before the option than after it, too.
The patch makes a few files consistent with this style already used
in manpages.

17 years agoiptables 1.4.1-rc2 v1.4.1-rc2
Patrick McHardy [Mon, 26 May 2008 12:52:50 +0000 (14:52 +0200)] 
iptables 1.4.1-rc2

17 years agoREDIRECT: Allow symbolic port in REDIRECT --to-port
Kristof Provost [Sun, 25 May 2008 22:55:34 +0000 (00:55 +0200)] 
REDIRECT: Allow symbolic port in REDIRECT --to-port

Fixes Bugzilla 482.

Signed-off-by: Kristof Provost <kristof@sigsegv.be>
17 years agoMerge branch 'master' of vishnu.netfilter.org:/data/git/iptables
Patrick McHardy [Tue, 20 May 2008 15:18:38 +0000 (17:18 +0200)] 
Merge branch 'master' of vishnu.netfilter.org:/data/git/iptables

17 years agoDon't assume /bin/sh is bash
Thomas Jacob [Tue, 20 May 2008 15:17:02 +0000 (17:17 +0200)] 
Don't assume /bin/sh is bash

The new iptables git version assumes /bin/sh is always GNU bash,
that's not the case (Ubuntu 8.04 uses dash), see attachment
for a fix.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoBump version to 1.4.1-rc1 v1.4.1-rc1
Patrick McHardy [Mon, 19 May 2008 10:55:05 +0000 (12:55 +0200)] 
Bump version to 1.4.1-rc1

Actually its not a bump but a decrease, the autoconf patches
apparently sneaked it a version bump to 1.4.1 already.

17 years agofix ip6tables dest address printing
Jamie Strandboge [Fri, 16 May 2008 12:52:12 +0000 (14:52 +0200)] 
fix ip6tables dest address printing

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464244

ip6tables improperly displays the destination address when the address
is longer than 18 characters.  Here is example output:
...
DROP       tcp      2001:db8::/32        2001:db8:3:4:5:6:7:8/128tcp spt:25
...

Proper formatting should have a space between '2001:db8:3:4:5:6:7:8/128'
and 'tcp'.

Signed-off-by: Jamie Strandboge <jamie@ubuntu.com>
Signed-off-by: Lawrence J. Lane <ljlane@debian.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoMake --set-counters (-c) accept comma separated counters
Henrik Nordstrom [Tue, 13 May 2008 11:10:38 +0000 (13:10 +0200)] 
Make --set-counters (-c) accept comma separated counters

Here is the --set-counters syntax patch requested earlier today making
--set-counters (-c) accept comma separated counts.

-c packets,bytes

I have not updated the manpage to reflect this alternate syntax for the
--set-counters (-c) option.

Henrik Nordstrom <henrik@henriknordstrom.net>

17 years agoiptables --list chain rulenum
Henrik Nordstrom [Tue, 13 May 2008 11:09:23 +0000 (13:09 +0200)] 
iptables --list chain rulenum

Excent --list (and --list-rules) to allow selection of a single rule
number

iptables --list INPUT 4
iptables --list-rules INPUT 4

list rule number 4 in INPUT.

Henrik Nordstrom <henrik@henriknordstrom.net>

17 years agoiptables --list-rules command
Henrik Nordstrom [Tue, 13 May 2008 11:08:26 +0000 (13:08 +0200)] 
iptables --list-rules command

Adds iptables --list-rules (-S) command, acting as a combination of
iptables --list and iptables-save.

The primary motivation behind this patch is to get iptables-save like
output capabilities in iptables-restore, allowing "iptables-restore -n"
to be used as a consistent API to iptables for all kind of operations,
not only blind updates..

As a bonus iptables also gets the capability of printing the rules
as-is.

This completely replaces the earlier patch which added the --rules
option.

Henrik Nordstrom <henrik@henriknordstrom.net>

17 years agoAdd support for --set-counters to iptables -P
Henrik Nordstrom [Mon, 12 May 2008 18:53:16 +0000 (20:53 +0200)] 
Add support for --set-counters to iptables -P

Adds support for setting the policy counters

iptables -P INPUT -J DROP -c 10 20

Henrik Nordstrom <henrik@henriknordstrom.net>

17 years agoMake iptables-restore usable over a pipe
Henrik Nordstrom [Mon, 12 May 2008 18:51:45 +0000 (20:51 +0200)] 
Make iptables-restore usable over a pipe

The attached patch flushes stdout between commands to make output
operations (-L etc) in iptables-restore usable over a pipe. stdio by
defaut buffers output if not connected to a terminal.

Henrik Nordstrom <henrik@henriknordstrom.net>

17 years agoiptables out-of-tree build directory
Jan Engelhardt [Mon, 12 May 2008 08:28:34 +0000 (10:28 +0200)] 
iptables out-of-tree build directory

Reported by: Henrik Nordstrom

When xtables.h is not already found in /usr/include, compilation
would fail when ${top_srcdir} != ${top_builddir}.

17 years ago[PATCH 1] Makefile.am: use PACKAGE_TARNAME
Jan Engelhardt [Thu, 17 Apr 2008 08:32:13 +0000 (10:32 +0200)] 
[PATCH 1] Makefile.am: use PACKAGE_TARNAME

17 years agoiptables-save:remove unnecessary code.
Shan Wei [Mon, 21 Apr 2008 10:23:38 +0000 (10:23 +0000)] 
iptables-save:remove unnecessary code.

The following code is never be used. It should be removed.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
17 years agoProperly initialize revision for ip6tables targets
Patrick McHardy [Tue, 15 Apr 2008 13:51:19 +0000 (15:51 +0200)] 
Properly initialize revision for ip6tables targets

Also resync error handling with iptables.

17 years agoRemove old functions, constants
Jan Engelhardt [Tue, 15 Apr 2008 09:48:25 +0000 (11:48 +0200)] 
Remove old functions, constants

17 years ago[PATCH 11] configure.ac: remove already-defined variables
Jan Engelhardt [Tue, 15 Apr 2008 11:17:47 +0000 (13:17 +0200)] 
[PATCH 11] configure.ac: remove already-defined variables

17 years agoDynamically create xtables.h.in with version
Jan Engelhardt [Tue, 15 Apr 2008 09:15:16 +0000 (11:15 +0200)] 
Dynamically create xtables.h.in with version

17 years agoconfigure.ac: AC_SUBST must be separate
Jan Engelhardt [Tue, 15 Apr 2008 07:13:17 +0000 (09:13 +0200)] 
configure.ac: AC_SUBST must be separate

17 years agoUpdate documentation about building the package
Jan Engelhardt [Mon, 11 Feb 2008 13:11:14 +0000 (14:11 +0100)] 
Update documentation about building the package

17 years agoResolve libipt_set warnings
Jan Engelhardt [Mon, 14 Apr 2008 14:03:52 +0000 (16:03 +0200)] 
Resolve libipt_set warnings

17 years agoRemove support for compilation of conditional extensions
Jan Engelhardt [Wed, 13 Feb 2008 20:35:59 +0000 (21:35 +0100)] 
Remove support for compilation of conditional extensions

17 years agoWrap dlopen code into NO_SHARED_LIBS
Jan Engelhardt [Mon, 14 Apr 2008 16:37:57 +0000 (18:37 +0200)] 
Wrap dlopen code into NO_SHARED_LIBS

17 years agoResolve warnings on 64-bit compile
Jan Engelhardt [Mon, 14 Apr 2008 13:58:17 +0000 (15:58 +0200)] 
Resolve warnings on 64-bit compile

17 years agoCombine ipt and ip6t manpages
Jan Engelhardt [Thu, 14 Feb 2008 02:02:55 +0000 (03:02 +0100)] 
Combine ipt and ip6t manpages

Combine ipt and ip6t manpages

17 years agoImplement AF_UNSPEC as a wildcard for extensions
Jan Engelhardt [Thu, 14 Feb 2008 03:23:04 +0000 (04:23 +0100)] 
Implement AF_UNSPEC as a wildcard for extensions

17 years agoRATEEST: add manpage
Jan Engelhardt [Thu, 27 Mar 2008 04:48:14 +0000 (05:48 +0100)] 
RATEEST: add manpage

17 years agoiptables: use C99 lists for struct options
Gáspár Lajos [Thu, 27 Mar 2008 07:20:39 +0000 (08:20 +0100)] 
iptables: use C99 lists for struct options

17 years agoInstall libiptc header files because xtables.h depends on it
Jan Engelhardt [Mon, 11 Feb 2008 14:48:51 +0000 (15:48 +0100)] 
Install libiptc header files because xtables.h depends on it

17 years agoAdd all necessary header files - compilation fix for various cases
Jan Engelhardt [Mon, 11 Feb 2008 00:23:01 +0000 (01:23 +0100)] 
Add all necessary header files - compilation fix for various cases

Allow iptables to compile without a kernel source tree. This
implies fixing build for older kernels, such as 2.6.17 which
lack xt_SECMARK.h.

17 years agoImport iptables-apply
Martin F. Krafft [Sat, 12 Apr 2008 05:48:44 +0000 (07:48 +0200)] 
Import iptables-apply

17 years agoconfigure: split --enable-libipq from --enable-devel
Jan Engelhardt [Mon, 11 Feb 2008 14:01:03 +0000 (15:01 +0100)] 
configure: split --enable-libipq from --enable-devel

17 years agomanpages: update to reflect fine-grained control
Jan Engelhardt [Mon, 10 Mar 2008 16:55:53 +0000 (17:55 +0100)] 
manpages: update to reflect fine-grained control

17 years agomanpages: grammar and spelling
Jan Engelhardt [Mon, 10 Mar 2008 16:48:59 +0000 (17:48 +0100)] 
manpages: grammar and spelling

17 years agomanpages: fix broken markup (missing close tags)
Jan Engelhardt [Mon, 10 Mar 2008 16:45:42 +0000 (17:45 +0100)] 
manpages: fix broken markup (missing close tags)

17 years agoCombine IP{,6}T_LIB_DIR into XTABLES_LIBDIR
Jan Engelhardt [Mon, 11 Feb 2008 00:02:00 +0000 (01:02 +0100)] 
Combine IP{,6}T_LIB_DIR into XTABLES_LIBDIR

17 years agoAdd support for xt_hashlimit match revision 1
Jan Engelhardt [Sun, 10 Feb 2008 23:55:33 +0000 (00:55 +0100)] 
Add support for xt_hashlimit match revision 1

17 years agoxtables.h: move non-exported parts to internal.h
Jan Engelhardt [Thu, 10 Apr 2008 07:18:36 +0000 (09:18 +0200)] 
xtables.h: move non-exported parts to internal.h

17 years agoFix all remaining warnings (missing declarations, missing prototypes)
Jan Engelhardt [Sun, 10 Feb 2008 23:54:00 +0000 (00:54 +0100)] 
Fix all remaining warnings (missing declarations, missing prototypes)

17 years agoUpdate the libxt_owner manpage with the UID/GID-range feature
Jan Engelhardt [Sun, 10 Feb 2008 23:57:18 +0000 (00:57 +0100)] 
Update the libxt_owner manpage with the UID/GID-range feature

17 years agoFix -Wshadow warnings and clean up xt_sctp.h
Jan Engelhardt [Sun, 10 Feb 2008 23:33:30 +0000 (00:33 +0100)] 
Fix -Wshadow warnings and clean up xt_sctp.h

Note: xt_sctp.h is still not merged upstream in the kernel as of
this commit. But a refactoring was really needed.

17 years agoDrop -W from CFLAGS and some tiny code cleanups
Jan Engelhardt [Mon, 3 Mar 2008 11:30:41 +0000 (12:30 +0100)] 
Drop -W from CFLAGS and some tiny code cleanups

- change "unsigned" to explicit "unsigned int"
- remove some casts

17 years agoMakefile: add a "tarball" target
Jan Engelhardt [Mon, 3 Mar 2008 12:04:07 +0000 (13:04 +0100)] 
Makefile: add a "tarball" target

17 years agoCorrect the family member value of libxt_mark revision 1
Jan Engelhardt [Thu, 14 Feb 2008 01:10:34 +0000 (02:10 +0100)] 
Correct the family member value of libxt_mark revision 1

libxt_mark rev1 used AF_INET6 in the class structure where it should
have used AF_INET.

17 years agoFix compilation of iptables-static build
Jan Engelhardt [Sun, 10 Feb 2008 23:29:36 +0000 (00:29 +0100)] 
Fix compilation of iptables-static build

Adjust the _INIT macro and thus fix the build/linking procedure of
the monolithic do-it-all binary (iptables-static).

Also fix the Makefile since unfortunately, lib%.o does not seem to
have a higher precedence than %.o

17 years agoRetry ruleset dump when kernel returns EAGAIN.
Patrick McHardy [Wed, 2 Apr 2008 12:01:53 +0000 (14:01 +0200)] 
Retry ruleset dump when kernel returns EAGAIN.

Bugzilla #104

17 years ago[IPTABLES]: libxt_iprange: Fix IP validation logic
James King [Tue, 1 Apr 2008 19:17:36 +0000 (21:17 +0200)] 
[IPTABLES]: libxt_iprange: Fix IP validation logic

IP address validation logic was inverted, causing valid addresses to
be rejected.

Signed-off-by: James King <t.james.king@gmail.com>
17 years agoremoves useless white spaces from iptables-xml manpages.
Filippo Zangheri [Thu, 6 Mar 2008 01:19:26 +0000 (02:19 +0100)] 
removes useless white spaces from iptables-xml manpages.
Signed-off-by: Filippo Zangheri <filippo.zangheri@yahoo.it>
17 years agobump iptables version to prepare 1.4.1 release
Pablo Neira Ayuso [Sun, 2 Mar 2008 12:40:26 +0000 (13:40 +0100)] 
bump iptables version to prepare 1.4.1 release

17 years agoFix define value of SCTP chunk type.
Naohiro Ooiwa [Fri, 29 Feb 2008 12:45:27 +0000 (12:45 +0000)] 
Fix define value of SCTP chunk type.

There are wrong chunk_type values in sctp table.
The chunk_type of ASCONF and ASCNF_ACK must be 193 and 128, respectively.

Naohiro Ooiwa <nooiwa@miraclelinux.com>

17 years agoRemove compiler.h inclusions.
Patrick McHardy [Fri, 22 Feb 2008 15:00:57 +0000 (15:00 +0000)] 
Remove compiler.h inclusions.

17 years agoAdd netfilter.h
Patrick McHardy [Tue, 29 Jan 2008 14:34:27 +0000 (14:34 +0000)] 
Add netfilter.h

17 years agofix gcc warnings
Max Kellermann [Tue, 29 Jan 2008 13:48:05 +0000 (13:48 +0000)] 
fix gcc warnings

Max Kellermann <max@duempel.org>

17 years agoallow empty strings in argument parser
Max Kellermann [Tue, 29 Jan 2008 13:46:01 +0000 (13:46 +0000)] 
allow empty strings in argument parser

Max Kellermann <max@duempel.org>

17 years agounescape parameters
Max Kellermann [Tue, 29 Jan 2008 13:45:29 +0000 (13:45 +0000)] 
unescape parameters

Max Kellermann <max@duempel.org>

17 years agoescape strings
Max Kellermann [Tue, 29 Jan 2008 13:44:34 +0000 (13:44 +0000)] 
escape strings

Max Kellermann <max@duempel.org>

17 years agouse size_t
Max Kellermann [Tue, 29 Jan 2008 13:43:35 +0000 (13:43 +0000)] 
use size_t

Max Kellermann <max@duempel.org>

17 years agowhitespace cleanup
Max Kellermann [Tue, 29 Jan 2008 13:42:48 +0000 (13:42 +0000)] 
whitespace cleanup

Max Kellermann <max@duempel.org>

17 years agoFix REDIRECT manpage
Max Kellermann [Tue, 29 Jan 2008 13:40:11 +0000 (13:40 +0000)] 
Fix REDIRECT manpage

Max Kellermann <max@duempel.org>

17 years ago[IPTABLES]: libxt_owner: UID/GID range support
Jan Engelhardt [Tue, 29 Jan 2008 13:38:05 +0000 (13:38 +0000)] 
[IPTABLES]: libxt_owner: UID/GID range support

UID/GID range support for libxt_owner

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years ago[IPTABLES]: libxt_conntrack revision 1
Jan Engelhardt [Tue, 29 Jan 2008 13:37:21 +0000 (13:37 +0000)] 
[IPTABLES]: libxt_conntrack revision 1

Add support for xt_conntrack match revision 1.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_CONNMARK revision 1
Jan Engelhardt [Tue, 29 Jan 2008 13:36:27 +0000 (13:36 +0000)] 
libxt_CONNMARK revision 1

Add support for xt_CONNMARK target revision 1.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agoBuild adjustments
Jan Engelhardt [Tue, 29 Jan 2008 13:33:23 +0000 (13:33 +0000)] 
Build adjustments

A few build system changes.
* ip6tables needs IP6T_LIB_DIR
* correctly trigger rebuild of master manpages when
  submanpages have been touched

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de.
17 years agoGive preference to iptables header files
Jan Engelhardt [Tue, 29 Jan 2008 13:32:07 +0000 (13:32 +0000)] 
Give preference to iptables header files

Have the header files in the iptables source tree take precedence
over those from the kernel source. Otherwise, building the current
iptables from subversion just fails with kernels < 2.6.25.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agoRemove obsolete file
Patrick McHardy [Sun, 20 Jan 2008 16:53:12 +0000 (16:53 +0000)] 
Remove obsolete file

17 years agolibxt_TCPOPTSTRIP
Sven Schnelle [Sun, 20 Jan 2008 13:45:16 +0000 (13:45 +0000)] 
libxt_TCPOPTSTRIP

Import libxt_TCPOPTSTRIP into iptables.

Signed-off-by: Sven Schnelle <svens@bitebene.org>
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_iprange r1
Jan Engelhardt [Sun, 20 Jan 2008 13:43:49 +0000 (13:43 +0000)] 
libxt_iprange r1

Add support for xt_iprange revision 1

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_iprange r0
Jan Engelhardt [Sun, 20 Jan 2008 13:42:43 +0000 (13:42 +0000)] 
libxt_iprange r0

Move libipt_iprange to libxt_iprange.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_mark r1
Jan Engelhardt [Sun, 20 Jan 2008 13:41:22 +0000 (13:41 +0000)] 
libxt_mark r1

Introduce libxt_mark match revision 1 support.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_hashlimit checks
Jan Engelhardt [Sun, 20 Jan 2008 13:39:11 +0000 (13:39 +0000)] 
libxt_hashlimit checks

Add checks for libxt_hashlimit so that options cannot be passed twice

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agorename overlapping function names
Jan Engelhardt [Sun, 20 Jan 2008 13:38:08 +0000 (13:38 +0000)] 
rename overlapping function names

Rename overlapping function names.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agobunch o' renames
Jan Engelhardt [Sun, 20 Jan 2008 13:36:08 +0000 (13:36 +0000)] 
bunch o' renames

Move a few functions from iptables.c/ip6tables.c to xtables.c
so they are available for combined (both AF_INET and AF_INET6)
libxt modules. Rename overlapping function names.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_conntrack r0
Jan Engelhardt [Sun, 20 Jan 2008 13:34:07 +0000 (13:34 +0000)] 
libxt_conntrack r0

Move libipt_conntrack to libxt_conntrack.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agoprint warning when dlopen fails
Jan Engelhardt [Sun, 20 Jan 2008 13:32:50 +0000 (13:32 +0000)] 
print warning when dlopen fails

If the file exists but could not be loaded, print the dlerror().
Often it is a missing symbol.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_connmark r1
Jan Engelhardt [Sun, 20 Jan 2008 13:32:01 +0000 (13:32 +0000)] 
libxt_connmark r1

Add support for xt_connmark match revision 1.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_MARK r2
Jan Engelhardt [Sun, 20 Jan 2008 13:31:13 +0000 (13:31 +0000)] 
libxt_MARK r2

Add support for xt_MARK target revision 2.
Also consolidate libip6t_MARK.man and libipt_MARK.man.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_TOS
Jan Engelhardt [Sun, 20 Jan 2008 13:25:08 +0000 (13:25 +0000)] 
libxt_TOS

Move libipt_TOS revision 0 to libxt_TOS revision 0 and add support
for xt_TOS target revision 1.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_tos
Jan Engelhardt [Sun, 20 Jan 2008 13:22:42 +0000 (13:22 +0000)] 
libxt_tos

Move libipt_tos revision 0 to libxt_tos revision 0 and add support
for xt_tos match revision 1.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agolibxt_owner
Jan Engelhardt [Sun, 20 Jan 2008 13:21:38 +0000 (13:21 +0000)] 
libxt_owner

libxt_owner merges libipt_owner and libip6t_owner, and adds support
for the xt_owner match revision 1.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agocommon error messages
Jan Engelhardt [Sun, 20 Jan 2008 13:19:40 +0000 (13:19 +0000)] 
common error messages

Error messages vary wildly among modules, and there is a lot of
reundance in it too. Introduce a helper function that does all of
the parameter checking boilerplate and gives unique messages.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agoIntroduce strtonum(), which works like string_to_number(), but passes
Jan Engelhardt [Sun, 20 Jan 2008 13:18:54 +0000 (13:18 +0000)] 
Introduce strtonum(), which works like string_to_number(), but passes
back the 'end' pointer. It is useful where you want to do boundary
checking yet work with strings that are not entirely slurped by
strtoul(), e.g.:

s = "1/2"; /* one half */
if (!strtonum(s, &end, &value, 0, 5))
error("Zero-length string, or value out of bounds");
if (*end != '/')
error("Malformed string");
info->param1 = value;
if (!strtonum(end + 1, &end, &value, 2, 4))
error("..");
if (*end != '\0')
error("Malformed string");
info->param2 = value;

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years agoConverts the iptables build infrastructure to autotools.
Jan Engelhardt [Sun, 20 Jan 2008 13:14:00 +0000 (13:14 +0000)] 
Converts the iptables build infrastructure to autotools.

- Can build both static and dynamic at the same time

- iptables-static will be a multi-binary, semi-static
(link against libc but w/o dynamic plugins)

- Always build IPv6 modules

- consider INSTALL

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
17 years ago- cleanup several code wraparounds
Pablo Neira Ayuso [Thu, 17 Jan 2008 17:30:27 +0000 (17:30 +0000)] 
- cleanup several code wraparounds
- check for malloc() return value in merge_opts()
- check for merge_opts() return value

17 years agoAdd rateest match extension
Patrick McHardy [Tue, 15 Jan 2008 17:27:04 +0000 (17:27 +0000)] 
Add rateest match extension

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoAdd RATEEST target extension
Patrick McHardy [Tue, 15 Jan 2008 17:25:39 +0000 (17:25 +0000)] 
Add RATEEST target extension

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years agoSolving scalability issue: for chain list "name" searching.
Jesper Dangaard Brouer [Tue, 15 Jan 2008 17:18:15 +0000 (17:18 +0000)] 
Solving scalability issue: for chain list "name" searching.

Solving scalability issue: for chain list "name" searching.
Functions: iptcc_find_label(), iptc_is_chain().

Testing if a chain exist, requires a linearly walk of linked list with
chain-names (doing a strcmp(3) in each step). Giving a worst-case
runtime of O(n) where n is the number of chains.

Why is this important to fix?! If only called once, this should not be
a big concern, even-though the string compares are expensive.

The performance issue arise with many chains for example; when using
"iptables-restore", or when listing all "iptables -nL" rules, or when
using CPAN IPTables::libiptc.

Having 50k chains, the rule listing, with the command:
 "./iptables -nL > /dev/null",
Without patch it takes approximately 5 minutes,
With the patch it takes 0.5 seconds.

Listing without patch:
 real    4m49.426s
 user    4m37.993s
 sys     0m0.280s

Listing with patch:
 real    0m0.558s
 user    0m0.484s
 sys     0m0.064s

How is it solved?!

The issue is solved introducing a new data structure, that allow us to
do binary search of chain names. Thus, reducing the worst-case runtime
to O(log n).

Being more specific:

 The new data structure is called "chain index", which is an array with
 pointers into the chain list, with CHAIN_INDEX_BUCKET_LEN spacing.
 This facilitates the ability to speedup chain list searching, by find
 a more optimal starting points when searching the linked list.

 The runtime complexity is actually also affected by this "bucket" size
 concept. Thus, O(log(n/k) + k) where k is CHAIN_INDEX_BUCKET_LEN.

 A nice property of the chain index, is that the "bucket" list
 length is max CHAIN_INDEX_BUCKET_LEN (when just build, inserts will
 change this). Oppose to hashing, where the "bucket" list length can
 vary a lot.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
17 years agoIntroduce a counter for number of user defined chains.
Jesper Dangaard Brouer [Tue, 15 Jan 2008 17:06:48 +0000 (17:06 +0000)] 
Introduce a counter for number of user defined chains.

Introduce a counter for number of user defined chains.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
17 years agoInline functions iptcc_is_builtin() and set_changed().
Jesper Dangaard Brouer [Tue, 15 Jan 2008 17:01:58 +0000 (17:01 +0000)] 
Inline functions iptcc_is_builtin() and set_changed().

The two functions are obvious candidates for inlining.
Using gprof(1) shows that they actually affects performance.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
17 years agoFix CONNMARK mask initialisation
Peter Warasin [Tue, 15 Jan 2008 15:46:35 +0000 (15:46 +0000)] 
Fix CONNMARK mask initialisation

This patch fixes the problem that the CONNMARK mask value
has been set to 0 whenever the CONNMARK target options were
not the last options to be processed.
It initalizes the mask value rather than setting it for
each parse.

Signed-off-by: Peter Warasin <peter@endian.com>
17 years agobump version from 1.4.0rc1 to 1.4.0 final v1.4.0
Pablo Neira Ayuso [Sat, 22 Dec 2007 12:56:28 +0000 (12:56 +0000)] 
bump version from 1.4.0rc1 to 1.4.0 final