]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect-engine-iponly: improve ip list performance
authorSimon Dugas <Simon.Dugas@cyber.gc.ca>
Fri, 29 Dec 2023 16:58:50 +0000 (11:58 -0500)
committerVictor Julien <victor@inliniac.net>
Wed, 14 Feb 2024 20:20:51 +0000 (21:20 +0100)
commit17f9d7aeccd5a69ef2e3344386d1585d231e2933
tree0e9a7ae12cddb85c0bdf6431bac5653f76fdf611
parent63caa0b40a66ecf1a34bbb6d942d4a044b7728a5
detect-engine-iponly: improve ip list performance

The runtime complexity of insertion sort is approx. O(h*n)^2 where
h is the size of the HOME_NET and n is the number of ip only rules
that use the HOME_NET.

Replacing this with qsort significantly improves rule load time when
a large HOME_NET is used in combination with a moderate amount of ip
only rules.
src/detect-engine-iponly.c