Fix bad protocols returned in ndpi_detection_giveup when detection is already complete
This commit is contained in:
+8
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user