Fix bad protocols returned in ndpi_detection_giveup when detection is already complete

This commit is contained in:
emanuele-f
2019-09-26 12:15:49 +02:00
parent 62fa0908a3
commit 937dcb38ea
+8 -2
View File
@@ -4044,8 +4044,14 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
if(flow == NULL)
return(ret);
else
ret.category = flow->category;
/* Init defaults */
ret.master_protocol = flow->detected_protocol_stack[1], ret.app_protocol = flow->detected_protocol_stack[0];
ret.category = flow->category;
/* Ensure that we don't change our mind if detection is already complete */
if((ret.master_protocol != NDPI_PROTOCOL_UNKNOWN) && (ret.app_protocol != NDPI_PROTOCOL_UNKNOWN))
return(ret);
/* TODO: add the remaining stage_XXXX protocols */
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {