summaryrefslogtreecommitdiffstats
path: root/libipq
diff options
context:
space:
mode:
authorgandalf <gandalf>2004-09-23 19:25:06 +0000
committergandalf <gandalf>2004-09-23 19:25:06 +0000
commit6b3b18690cfb393c121a2574c371e4cc9e7c5764 (patch)
treebcc4161e8c6019995903931a9fe1efa7439bb478 /libipq
parented53a70872a626a35ab9e8d00a3628ded6d076ac (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