diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-05-29 16:55:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 16:55:53 +0200 |
commit | 346bb268e22e190e79b16091817d5178a608d4a0 (patch) | |
tree | 939efeb80b6ac3bf3696a1582037cdfe8e664c2c | |
parent | 82fa3a098632006cc8edffb647cabee08843524a (diff) |
Avoid calling `ndpi_reconcile_protocols()` twice in `ndpi_detection_giveup()` (#1996)
`ndpi_reconcile_protocols()` is already called by
`ndpi_set_detected_protocol()`
-rw-r--r-- | src/lib/ndpi_main.c | 7 | ||||
-rw-r--r-- | tests/cfgs/default/result/teams.pcap.out | 2 | ||||
-rw-r--r-- | tests/cfgs/default/result/tls_certificate_too_long.pcap.out | 2 | ||||
-rw-r--r-- | tests/cfgs/default/result/tor.pcap.out | 2 |
4 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 5b340aba1..9776b0b02 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6432,16 +6432,15 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN && flow->guessed_protocol_id_by_ip != NDPI_PROTOCOL_UNKNOWN) { - ndpi_int_change_protocol(ndpi_str, flow, - flow->guessed_protocol_id_by_ip, ret.master_protocol, - NDPI_CONFIDENCE_MATCH_BY_IP); + ndpi_set_detected_protocol(ndpi_str, flow, + flow->guessed_protocol_id_by_ip, ret.master_protocol, + NDPI_CONFIDENCE_MATCH_BY_IP); ret.app_protocol = flow->detected_protocol_stack[0]; } if(ret.app_protocol != NDPI_PROTOCOL_UNKNOWN) { *protocol_was_guessed = 1; ndpi_fill_protocol_category(ndpi_str, flow, &ret); - ndpi_reconcile_protocols(ndpi_str, flow, &ret); } return(ret); diff --git a/tests/cfgs/default/result/teams.pcap.out b/tests/cfgs/default/result/teams.pcap.out index db1acf5db..bdff0b145 100644 --- a/tests/cfgs/default/result/teams.pcap.out +++ b/tests/cfgs/default/result/teams.pcap.out @@ -14,7 +14,7 @@ LRU cache zoom: 0/0/0 (insert/search/found) LRU cache stun: 6/42/18 (insert/search/found) LRU cache tls_cert: 0/0/0 (insert/search/found) LRU cache mining: 0/2/0 (insert/search/found) -LRU cache msteams: 28/20/16 (insert/search/found) +LRU cache msteams: 27/19/15 (insert/search/found) LRU cache stun_zoom: 0/0/0 (insert/search/found) Automa host: 85/71 (search/found) Automa domain: 85/0 (search/found) diff --git a/tests/cfgs/default/result/tls_certificate_too_long.pcap.out b/tests/cfgs/default/result/tls_certificate_too_long.pcap.out index c4df9246e..00c129e9c 100644 --- a/tests/cfgs/default/result/tls_certificate_too_long.pcap.out +++ b/tests/cfgs/default/result/tls_certificate_too_long.pcap.out @@ -13,7 +13,7 @@ LRU cache zoom: 0/0/0 (insert/search/found) LRU cache stun: 0/0/0 (insert/search/found) LRU cache tls_cert: 0/0/0 (insert/search/found) LRU cache mining: 0/2/0 (insert/search/found) -LRU cache msteams: 0/2/0 (insert/search/found) +LRU cache msteams: 0/1/0 (insert/search/found) LRU cache stun_zoom: 0/0/0 (insert/search/found) Automa host: 39/22 (search/found) Automa domain: 39/0 (search/found) diff --git a/tests/cfgs/default/result/tor.pcap.out b/tests/cfgs/default/result/tor.pcap.out index 69e1e9c76..bc2de97ff 100644 --- a/tests/cfgs/default/result/tor.pcap.out +++ b/tests/cfgs/default/result/tor.pcap.out @@ -11,7 +11,7 @@ LRU cache zoom: 0/0/0 (insert/search/found) LRU cache stun: 0/0/0 (insert/search/found) LRU cache tls_cert: 0/8/0 (insert/search/found) LRU cache mining: 0/1/0 (insert/search/found) -LRU cache msteams: 0/2/0 (insert/search/found) +LRU cache msteams: 0/1/0 (insert/search/found) LRU cache stun_zoom: 0/0/0 (insert/search/found) Automa host: 7/0 (search/found) Automa domain: 7/0 (search/found) |