mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-05-20 01:01:32 +00:00
In case a pattern is redefined (for instance with protos.txt), the custom definition overwrites the previous one (so far it was ignored)
This commit is contained in:
parent
6dcecd73d3
commit
0db12b1390
1 changed files with 11 additions and 0 deletions
11
src/lib/third_party/src/ahocorasick.c
vendored
11
src/lib/third_party/src/ahocorasick.c
vendored
|
|
@ -262,7 +262,18 @@ AC_ERROR_t ac_automata_add (AC_AUTOMATA_t * thiz, AC_PATTERN_t * patt)
|
|||
thiz->max_str_len = patt->length;
|
||||
|
||||
if(n->final && n->matched_patterns) {
|
||||
/*
|
||||
In this case an existing pattern exists and thus we overwrite
|
||||
the previous protocol value with this one
|
||||
*/
|
||||
|
||||
#if 1
|
||||
/* nDPI code */
|
||||
n->matched_patterns->patterns[0].rep.number = patt->rep.number;
|
||||
#else
|
||||
/* original code */
|
||||
patt->rep.number = n->matched_patterns->patterns[0].rep.number;
|
||||
#endif
|
||||
return ACERR_DUPLICATE_PATTERN;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue