Correcting a chain references increment bug in libiptc.
The bug lies in function iptc_delete_entry() / TC_DELETE_ENTRY. The
problem is the construction of "r" the rule entry, that is used for
comparison. The problem is that the function iptcc_map_target()
increase the target chains references count.
Phil Oester [Thu, 20 Jul 2006 16:59:04 +0000 (16:59 +0000)]
Use gcc to build shared objects (Phil Oester <kernel@linuxace.com>)
As suggested by Dmitry Levin and included in Fedora Core releases,
use gcc instead of ld to link shared objects. Fedora rpm notes
refer to this fixing a plugin problem, but does not offer specifics.
But in any event, 'gcc -dumpspecs' does show gcc will pass a number
of parameters which in theory it thinks are better.
Compile tested both with and without NO_SHARED_LIBS.
Phil Oester [Mon, 10 Jul 2006 04:52:56 +0000 (04:52 +0000)]
iptables: handle cidr notation more sanely (Phil Oester <kernel@linuxace.com>)
At present, a command such as
iptables -A foo -s 10.10/16
will interpret 10.10/16 as 10.0.0.10/16, and after applying the mask end
up with 10.0.0.0/16, which likely isn't what the user intended. Yet
some people do expect 10.10 (without the cidr notation) to end up as
10.0.0.10.
The below patch should satisfy all parties. It zero pads the missing
octets only in the cidr case, leaving the IP untouched otherwise.
Phil Oester [Mon, 3 Jul 2006 18:35:24 +0000 (18:35 +0000)]
ip6tables multiport does not support x:y (Phil Oester <kernel@linuxace.com>)
Update the manpage for ip6tables multiport match to reflect
reality -- it does not (yet) support x:y syntax. I looked at
adding it, but adding revision support to ip6tables seems a
waste at this point, since once xtables support is added to
iptables, this problem will resolve itself.
Cleanup a few compile warnings in latest snapshot:
extensions/libipt_dscp_helper.c:69: warning: 'dscp_to_name' defined but not used
extensions/libipt_sctp.c: In function 'print_chunks':
extensions/libipt_sctp.c:465: warning: value computed is not used
extensions/libipt_sctp.c:477: warning: value computed is not used
Phil Oester [Tue, 20 Jun 2006 13:45:38 +0000 (13:45 +0000)]
REDIRECT does not accept IP (Phil Oester <kernel@linuxace.com>)
As pointed out by Nicolas Mailhot in bugzilla #483, REDIRECT
does not accept an IP address and when supplied with one,
provides unexpected results. Patch below fixes this.
James Morris [Wed, 24 May 2006 16:11:58 +0000 (16:11 +0000)]
secmark: Add libselinux support
This patch adds the infrastructure for linking iptables against
libselinux, for use with the SECMARK target. This is enabled
by setting DO_SELINUX=1 in the build environment.
Harald Welte [Fri, 21 Apr 2006 12:31:53 +0000 (12:31 +0000)]
When entering an invalid command (such as iptables -A INPUT -j MARK --set-mark
1), the error message "Unknown error 4294967295" is displayed; (Closes: #460)
In ip[6]tables.c, NUMBER_OF_OPT was increased to 12 for the OPT_COUNTERS
option. However, the new array element is not initialized in either
commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] or
inverse_for_options[NUMBER_OF_OPT]. (Closes: #462)
Harald Welte [Fri, 21 Apr 2006 11:56:30 +0000 (11:56 +0000)]
cmdflags is used in cmd2char() to return the option for a command. It uses the
bit position of the command mask as an index in the array. There's no entry for
CMD_CHECK (0x0800U), so lookups for CMD_RENAME_CHAIN (0x1000U) index outside the
array. (Closes: #463)
The current ip6tables tries to load libip6t_icmp6.so when user types
'ip6tables -p icmpv6 ...' or 'ip6tables ... -m icmpv6' ...', and it fails.
This patch renames libip6t_icmpv6.c to libip6t_icmp6.c so that ip6tables
can load it. Now kernel module and user library has same name 'icmp6'.
It can reduce confusion about name mismatch. That's why I renamed it
instead of reverting change in find_match() which brought this bug.
This patch keeps compatibiity and we can use '-p icmpv6', '-p ipv6-icmpv6',
'-m icmpv6', '-m ipv6-icmpv6', and '-m icmp6', as ever.
Yasuyuki KOZAKAI [Wed, 29 Mar 2006 09:24:43 +0000 (09:24 +0000)]
don't allow to specify protocol of IPv6 extension header (Yasuyuki Kozakai)
Sometimes I hear that people do 'ip6tables -p ah ...' which never matches
any packet. IPv6 extension headers except of ESP are skipped and invalid
as argument of '-p'. Then I propose that ip6tables exits with error in such
case.
Harald Welte [Sat, 11 Feb 2006 09:34:16 +0000 (09:34 +0000)]
fix double-free if a single match is used multiple times within a signle rule
(Closes: #440). However, while this fixes the double-free, it still doesn't make iptables
support two of the same matches within one rule. Apparently the last matchinfo is copied into all the previous
matchinfo instances.
Harald Welte [Thu, 26 Jan 2006 14:43:52 +0000 (14:43 +0000)]
Add 'copy+paste' support for 'state' and 'connmark' match, as well as
'CONNMARK' target for ip6tables / nf_conntrack_l3proto_ipv6. This is a temporary solution for the iptables-1.3.x branch, since the 1.4.x branch will have proper support.
Phil Oester [Thu, 17 Nov 2005 13:34:51 +0000 (13:34 +0000)]
The conntrack match does not print any info for --ctproto, thus
breaking iptables-restore of any rules using this option. Below
patch adds output and closes bug #398. (Phil Oester)
Deti Fliegl [Thu, 3 Nov 2005 18:43:14 +0000 (18:43 +0000)]
fix connmark, it's now only 32bits (Deti Fliegl <deti@fliegl.de)
We'ver screwed this up with the 2.6.14 release. It refuses any mask that
extends 32bits. We should have fixed this by adding a new target/match
revision, but now it's too late anyway :(