diff options
author | Luca Deri <deri@ntop.org> | 2016-12-10 19:30:42 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2016-12-10 19:30:42 +0100 |
commit | 7d82948bd19c53043afe9638f749ebdde25d43b6 (patch) | |
tree | 8f631eaa45b82cff5bdada20af30b741255b27da /src | |
parent | f7515514bdd16189f21513c9c0c034d8c585e4d6 (diff) |
Improvement on ndpi_int_change_protocol() accuracy
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 0e1e05bed..f457bedd1 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4144,11 +4144,17 @@ void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol) { + if((upper_detected_protocol == NDPI_PROTOCOL_UNKNOWN) + && (lower_detected_protocol != NDPI_PROTOCOL_UNKNOWN)) + upper_detected_protocol = lower_detected_protocol; + if(upper_detected_protocol == lower_detected_protocol) lower_detected_protocol = NDPI_PROTOCOL_UNKNOWN; - - ndpi_int_change_flow_protocol(ndpi_struct, flow, upper_detected_protocol, lower_detected_protocol); - ndpi_int_change_packet_protocol(ndpi_struct, flow, upper_detected_protocol, lower_detected_protocol); + + ndpi_int_change_flow_protocol(ndpi_struct, flow, + upper_detected_protocol, lower_detected_protocol); + ndpi_int_change_packet_protocol(ndpi_struct, flow, + upper_detected_protocol, lower_detected_protocol); } |