diff options
author | emanuele-f <black.silver@hotmail.it> | 2018-10-10 15:56:46 +0200 |
---|---|---|
committer | emanuele-f <black.silver@hotmail.it> | 2018-10-10 15:56:46 +0200 |
commit | 40294f3aed28456332bef71e8cfaea36b2e82a6c (patch) | |
tree | b0b207e80963f2504fbd41de4d20f9ba0702bd6e /src | |
parent | 67a1a07ac1eee40e48f262d17447711cbdf6f148 (diff) |
Custom categories have now priority over protocol related categories
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index b2abe0068..7b9205081 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4233,11 +4233,6 @@ int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_str) void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, ndpi_protocol *ret) { - if(flow->category != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED) { - ret->category = flow->category; - return; - } - if(ndpi_struct->custom_categories.categories_loaded) { if(flow->packet.iph) { prefix_t prefix; @@ -5895,7 +5890,9 @@ static int ndpi_automa_match_string_subprotocol(struct ndpi_detection_module_str packet->detected_protocol_stack[0] = matching_protocol_id; flow->detected_protocol_stack[0] = packet->detected_protocol_stack[0], - flow->detected_protocol_stack[1] = packet->detected_protocol_stack[1], + flow->detected_protocol_stack[1] = packet->detected_protocol_stack[1]; + + if(flow->category == NDPI_PROTOCOL_CATEGORY_UNSPECIFIED) flow->category = ret_match->protocol_category; return(packet->detected_protocol_stack[0]); |