opnsense-src/sys/netinet/libalias
Lutz Donnerhacke 3a96a25da8 libalias: Switch to SPLAY trees
Current data structure is using a hash of unordered lists.  Those
unordered lists are quite efficient, because the least recently
inserted entries are most likely to be used again.  In order to avoid
long search times in other cases, the lists are hashed into many
buckets.  Unfortunatly a search for a miss needs an exhaustive
inspection and a careful definition of the hash.

Splay trees offer a similar feature - almost O(1) for access of the
least recently used entries), and amortized O(ln(n) - for almost all
other cases.  Get rid of the hash.

Now the data structure should able to quickly react to external
packets without eating CPU cycles for breakfast, preventing a DoS.

PR:		192888
Discussed with:	Dimitry Luhtionov
Differential Revision: https://reviews.freebsd.org/D30516
Differential Revision: https://reviews.freebsd.org/D30536
Differential Revision: https://reviews.freebsd.org/D30844

(cherry picked from commit 935fc93af1)
(cherry picked from commit d261e57dea)
(cherry picked from commit f70c98a2f5)
(cherry picked from commit 25392fac94)
(cherry picked from commit 2f4d91f9cb)
(cherry picked from commit 4060e77f49)
2021-07-06 08:55:53 +02:00
..
alias.c libalias: Remove unused function LibAliasCheckNewLink 2021-06-07 07:48:07 +02:00
alias.h libalias: Remove unused function LibAliasCheckNewLink 2021-06-07 07:48:07 +02:00
alias_db.c libalias: Switch to SPLAY trees 2021-07-06 08:55:53 +02:00
alias_db.h libalias: Switch to SPLAY trees 2021-07-06 08:55:53 +02:00
alias_dummy.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_ftp.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_irc.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_local.h libalias: Switch to SPLAY trees 2021-07-06 08:55:53 +02:00
alias_mod.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_mod.h malloc: try to use builtins for zeroing at the callsite 2018-06-02 22:20:09 +00:00
alias_nbt.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_pptp.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_proxy.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_sctp.c libalias: Promote per instance global variable timeStamp 2021-07-06 08:55:53 +02:00
alias_sctp.h libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_skinny.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_smedia.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
alias_util.c libalias: Style cleanup 2021-05-29 15:08:02 +02:00
HISTORY libalias: Switch to SPLAY trees 2021-07-06 08:55:53 +02:00
libalias.3 libalias: Remove unused function LibAliasCheckNewLink 2021-06-07 07:48:07 +02:00