summaryrefslogtreecommitdiffstats
path: root/libipq
diff options
context:
space:
mode:
authorMartin Josefsson <gandalf@wlug.westbo.se>2004-09-23 19:25:06 +0000
committerMartin Josefsson <gandalf@wlug.westbo.se>2004-09-23 19:25:06 +0000
commit631f3619b7fb597f5e1c8f61c7178d64be7c144f (patch)
treebcc4161e8c6019995903931a9fe1efa7439bb478 /libipq
parent12009531e6a96a62ee398eb0ab3e9ec0b3b57701 (diff)
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.
Diffstat (limited to 'libipq')
0 files changed, 0 insertions, 0 deletions