From 40294f3aed28456332bef71e8cfaea36b2e82a6c Mon Sep 17 00:00:00 2001 From: emanuele-f Date: Wed, 10 Oct 2018 15:56:46 +0200 Subject: Custom categories have now priority over protocol related categories --- src/lib/ndpi_main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/lib/ndpi_main.c') 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]); -- cgit v1.2.3