[netfilter-cvslog] CVS update: iptables/libiptc

Martin Josefsson gandalf at cvs.netfilter.org
Thu Sep 23 21:25:06 CEST 2004


Date:	Thu Sep 23 21:25:06 2004
Author:	gandalf

Update of /cvsroot/iptables/libiptc
In directory coruscant.gnumonks.org:/tmp/cvs-serv15714

Modified Files:
	libiptc.c 
Log Message:
Replace O(n) with O(1) when TC_INSERT_ENTRY() inserts an entry at the end.
Do the same with TC_DELETE_NUM_ENTRY() when deleting the last rule.

My rule management script does both of these things in certain situations.
Created a file with 50.000 rules which my script converted into
iptables-restore format but inserting each rule with an index instead of
appending like the iptables-save output does. That took a while without this
optimization.  Same thing when deleting the 45.000 last rules in that chain,
the script outputs deletes by number starting from the bottom.

Inserting or deleting (by number) in the middle of the chain is still O(n)
where n is the rulenumber where the insert/delete is taking place.



Revisions:
libiptc.c		1.58 => 1.59
	http://cvs.netfilter.org/iptables/libiptc/libiptc.c?r1=1.58&r2=1.59



More information about the netfilter-cvslog mailing list