Fix category field not accounted in ndpi_get_proto_category

Fixes #627
This commit is contained in:
emanuele-f
2018-10-10 10:43:51 +02:00
parent cf0c8be63d
commit 6ff6c2e5af
+3 -1
View File
@@ -5599,8 +5599,10 @@ const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod
ndpi_protocol_category_t ndpi_get_proto_category(struct ndpi_detection_module_struct *ndpi_mod,
ndpi_protocol proto) {
if(proto.category != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED)
return proto.category;
/* simple rule: sub protocol first, master after */
if((proto.master_protocol == NDPI_PROTOCOL_UNKNOWN) ||
else if((proto.master_protocol == NDPI_PROTOCOL_UNKNOWN) ||
(ndpi_mod->proto_defaults[proto.app_protocol].protoCategory != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED))
return ndpi_mod->proto_defaults[proto.app_protocol].protoCategory;
else