netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IPTABLES 0/2] iptables-compat fixes
@ 2015-07-21 13:45 Thomas Woerner
  2015-07-21 13:45 ` [IPTABLES 1/2] iptables-compat: Allow to insert into rule_count+1 position Thomas Woerner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Woerner @ 2015-07-21 13:45 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Thomas Woerner

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-23 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-21 13:45 [IPTABLES 0/2] iptables-compat fixes Thomas Woerner
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

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).