Added fix for discarding core protocols as subprotocols
This commit is contained in:
@@ -321,14 +321,17 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
check result of host subprotocol detection
|
check result of host subprotocol detection
|
||||||
|
|
||||||
if "detected" in flow == 0 then "detected" = "guess"
|
if "detected" in flow == 0 then "detected" = "guess"
|
||||||
else "guess" = "detected"
|
else "guess" = "detected"
|
||||||
**/
|
**/
|
||||||
if(flow->detected_protocol_stack[1] == 0) {
|
if(flow->detected_protocol_stack[1] == NDPI_PROTOCOL_UNKNOWN) {
|
||||||
flow->detected_protocol_stack[1] = flow->guessed_protocol_id;
|
/* Avoid putting as subprotocol a "core" protocol such as SSL or DNS */
|
||||||
if(flow->detected_protocol_stack[0] == 0)
|
if(ndpi_struct->proto_defaults[flow->guessed_protocol_id].can_have_a_subprotocol == 0) {
|
||||||
flow->detected_protocol_stack[0] = flow->guessed_host_protocol_id;
|
flow->detected_protocol_stack[1] = flow->guessed_protocol_id;
|
||||||
|
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
|
||||||
|
flow->detected_protocol_stack[0] = flow->guessed_host_protocol_id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(flow->detected_protocol_stack[1] != flow->guessed_protocol_id)
|
if(flow->detected_protocol_stack[1] != flow->guessed_protocol_id)
|
||||||
@@ -336,7 +339,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
if(flow->detected_protocol_stack[0] != flow->guessed_host_protocol_id)
|
if(flow->detected_protocol_stack[0] != flow->guessed_host_protocol_id)
|
||||||
flow->guessed_host_protocol_id = flow->detected_protocol_stack[0];
|
flow->guessed_host_protocol_id = flow->detected_protocol_stack[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
|
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
|
||||||
&& ((ndpi_struct->http_dont_dissect_response) || flow->http_detected)
|
&& ((ndpi_struct->http_dont_dissect_response) || flow->http_detected)
|
||||||
&& (packet->http_origin.len > 0)) {
|
&& (packet->http_origin.len > 0)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user