From: Peter Volkov <pva@gentoo.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: [patch] iptables-1.4.3.1: unabled to restore ! -s 192.168.1.0/24 match
Date: Sat, 04 Apr 2009 13:50:34 +0400 [thread overview]
Message-ID: <1238838634.31963.578.camel@localhost> (raw)
In-Reply-To: <49C8DB3B.909@netfilter.org>
[-- Attachment #1.1: Type: text/plain, Size: 445 bytes --]
Hi. We've received bug report about broken ! -s 192.168.1.0/24 match:
http://bugs.gentoo.org/264089
Steps to reproduce:
iptables -A INPUT -i eth0 ! --src 192.168.1.0/24
iptables-save > ruleset
iptables-restore < ruleset
Using intrapositioned negation (`--option ! this`) is deprecated in favor of extrapositioned (`! --option this`).
Patch in attachment is supposed to fix this issue. Please, if it's
correct, apply.
--
Peter.
[-- Attachment #1.2: iptables-1.4.3.1-src-save-restore.patch --]
[-- Type: text/x-patch, Size: 829 bytes --]
commit ba8b9d5559050b17da5562b8be21854289937b3e
Author: Peter Volkov <pva@gentoo.org>
Date: Sat Apr 4 13:33:59 2009 +0400
Fix save of negated match (! -s 192.168.1.0/24)
iptables-restore unabled to restore ! -s 192.168.1.0/24 match saved by
iptables-save. This patch fixes ordering of output issued by print_ip.
Reported at http://bugs.gentoo.org/264089, thank Yar Odin for report.
diff --git a/iptables.c b/iptables.c
index 3449dec..fe43ab0 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1089,9 +1089,9 @@ static void print_ip(char *prefix, u_int32_t ip, u_int32_t mask, int invert)
if (!mask && !ip && !invert)
return;
- printf("%s %s%u.%u.%u.%u",
- prefix,
+ printf("%s%s %u.%u.%u.%u",
invert ? "! " : "",
+ prefix,
IP_PARTS(ip));
if (mask == 0xFFFFFFFFU) {
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2009-04-04 9:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-24 13:08 [ANNOUNCE]: Release of iptables-1.4.3.1 Pablo Neira Ayuso
2009-03-24 21:12 ` Steven Jan Springl
2009-03-24 21:32 ` Jan Engelhardt
2009-03-25 12:50 ` Pablo Neira Ayuso
2009-03-28 14:17 ` Gabor Z. Papp
2009-04-04 9:50 ` Peter Volkov [this message]
2009-04-04 11:40 ` [patch] iptables-1.4.3.1: unabled to restore ! -s 192.168.1.0/24 match Jan Engelhardt
2009-04-05 10:23 ` Pablo Neira Ayuso
2009-04-05 11:41 ` Jan Engelhardt
2009-04-04 10:11 ` [patch] iptables-1.4.3.1: unabled to restore proto and iface negated matches Peter Volkov
2009-04-04 20:00 ` Negation bug Steven Jan Springl
2009-04-04 22:08 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1238838634.31963.578.camel@localhost \
--to=pva@gentoo.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.