Suricata is a network Intrusion Detection System, Intrusion Prevention System and Network Security Monitoring engine developed by the OISF and the Suricata community.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Victor Julien 7b4be598c4 radix: don't modify node prefix on lookup
The radix tree stores user data. However, it had no function to return
this data to the consumers of the API. Instead, on lookup, it would
set a field "user_data_result" in the nodes prefix structure which
could then be read by the caller.

Apart for this not being a very nice design as it exposes API internals
to the caller, it is not thread safe. By updating the global data
structure without any form (or suggestion) of locking, threads could
overwrite the same field unexpectedly.

This patch modifies the lookup logic to get rid of this stored
user_data_result. Instead, all the lookup functions how take an
addition argument: void **user_data_result.

Through this pointer the user data is returned. It's allowed to be
NULL, in this case the user data is ignored.

This is a significant API change, that affects a lot of tests and
callers. These will be updated in follow up patches.

Bug #1073.
12 years ago
benches
contrib Add option on Tile-Gx for logging for fast.log alerts over PCIe 12 years ago
doc Update docs from wiki 13 years ago
m4 Prelude plugin: add detection in configure script 16 years ago
qa Updated banned function cocci check 12 years ago
rules dns: add event for when memcap is reached 12 years ago
scripts suricatasc: fix make distcheck. 13 years ago
src radix: don't modify node prefix on lookup 12 years ago
.gitignore unittest: make check use a qa/log dir for logging 12 years ago
COPYING
ChangeLog Update Changelog for 2.0beta2 12 years ago
LICENSE import of gplv2 LICENSE 16 years ago
Makefile.am dns: rules files was not installed 12 years ago
Makefile.cvs
acsite.m4 Added C99 defs/macros to acsite.m4 for CentOS 16 years ago
autogen.sh OpenBSD 5.2 build fixes, Unit test fix. 13 years ago
classification.config Import of classification.config 16 years ago
config.rpath Add file needed for some autotools version. 12 years ago
configure.ac Remove extra ] configure.ac for HAVE_DETECT_DISABLED 12 years ago
doxygen.cfg doxygen: document all code 12 years ago
reference.config Add md5 to reference.config. 14 years ago
suricata.yaml.in profiling: add sample-rate yaml option 12 years ago
threshold.config threshold: improve comments of shipped threshold.config, add links to wiki. 13 years ago