From: Thomas Woerner <twoerner@redhat.com>
To: netfilter-devel@vger.kernel.org
Cc: Thomas Woerner <twoerner@redhat.com>
Subject: [IPTABLES 0/2] iptables-compat fixes
Date: Tue, 21 Jul 2015 15:45:40 +0200 [thread overview]
Message-ID: <1437486342-6917-1-git-send-email-twoerner@redhat.com> (raw)
Here are the first patches from my tests with iptables-compat and firewalld:
The first patch is enabling to insert a rule into rule_count+1 position.
# iptables-compat -t filter -S INPUT
-P INPUT ACCEPT
[0:0] -A INPUT -s 1.2.3.4/32 -j DROP
# iptables-compat -t filter -I INPUT 2 -s 1.2.3.5 -j DROP
# iptables-compat -t filter -S INPUT
-P INPUT ACCEPT
[0:0] -A INPUT -s 1.2.3.4/32 -j DROP
[0:0] -A INPUT -s 1.2.3.5/32 -j DROP
This is possible with iptables, but not possible with iptables-compat.
Maybe it would be good to add nft_rule_list_count or similar and use it here.
The second patch fixes the rule number handling in nft_rule_find and
__nft_rule_list. The rule number is only valid in the selected table and chain
and therefore may not be increased for other tables or chains. With this patch
the correct rule will be removed with -D <name> i and listed with -S <name> i.
Thomas Woerner (2):
iptables-compat: Allow to insert into rule_count+1 position
iptables-compat: Increase rule number only for the selected table and
chain
iptables/nft.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
--
2.4.3
next reply other threads:[~2015-07-21 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 13:45 Thomas Woerner [this message]
2015-07-21 13:45 ` [IPTABLES 1/2] iptables-compat: Allow to insert into rule_count+1 position Thomas Woerner
2015-07-21 13:45 ` [IPTABLES 2/2] iptables-compat: Increase rule number only for the selected table and chain Thomas Woerner
2015-07-23 14:58 ` [IPTABLES 0/2] iptables-compat fixes Pablo Neira Ayuso
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=1437486342-6917-1-git-send-email-twoerner@redhat.com \
--to=twoerner@redhat.com \
--cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).