]> 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>
Thu, 15 Feb 2024 14:34:05 +0000 (15:34 +0100)
commita3eb58e21e3ca5add5443d7ff539dc457297a89d
treee9ca8333970414c8343a0421c54430c629bb410c
parent0cd1cd1c980791b60bc38195c86f164e0b1f53e9
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.

(cherry picked from commit 17f9d7aeccd5a69ef2e3344386d1585d231e2933)
src/detect-engine-iponly.c