Skip to content

Commit 346bb26

Browse files
authored
Avoid calling ndpi_reconcile_protocols() twice in ndpi_detection_giveup() (ntop#1996)
`ndpi_reconcile_protocols()` is already called by `ndpi_set_detected_protocol()`
1 parent 82fa3a0 commit 346bb26

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/lib/ndpi_main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6432,16 +6432,15 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
64326432
if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN &&
64336433
flow->guessed_protocol_id_by_ip != NDPI_PROTOCOL_UNKNOWN) {
64346434

6435-
ndpi_int_change_protocol(ndpi_str, flow,
6436-
flow->guessed_protocol_id_by_ip, ret.master_protocol,
6437-
NDPI_CONFIDENCE_MATCH_BY_IP);
6435+
ndpi_set_detected_protocol(ndpi_str, flow,
6436+
flow->guessed_protocol_id_by_ip, ret.master_protocol,
6437+
NDPI_CONFIDENCE_MATCH_BY_IP);
64386438
ret.app_protocol = flow->detected_protocol_stack[0];
64396439
}
64406440

64416441
if(ret.app_protocol != NDPI_PROTOCOL_UNKNOWN) {
64426442
*protocol_was_guessed = 1;
64436443
ndpi_fill_protocol_category(ndpi_str, flow, &ret);
6444-
ndpi_reconcile_protocols(ndpi_str, flow, &ret);
64456444
}
64466445

64476446
return(ret);

tests/cfgs/default/result/teams.pcap.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LRU cache zoom: 0/0/0 (insert/search/found)
1414
LRU cache stun: 6/42/18 (insert/search/found)
1515
LRU cache tls_cert: 0/0/0 (insert/search/found)
1616
LRU cache mining: 0/2/0 (insert/search/found)
17-
LRU cache msteams: 28/20/16 (insert/search/found)
17+
LRU cache msteams: 27/19/15 (insert/search/found)
1818
LRU cache stun_zoom: 0/0/0 (insert/search/found)
1919
Automa host: 85/71 (search/found)
2020
Automa domain: 85/0 (search/found)

tests/cfgs/default/result/tls_certificate_too_long.pcap.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LRU cache zoom: 0/0/0 (insert/search/found)
1313
LRU cache stun: 0/0/0 (insert/search/found)
1414
LRU cache tls_cert: 0/0/0 (insert/search/found)
1515
LRU cache mining: 0/2/0 (insert/search/found)
16-
LRU cache msteams: 0/2/0 (insert/search/found)
16+
LRU cache msteams: 0/1/0 (insert/search/found)
1717
LRU cache stun_zoom: 0/0/0 (insert/search/found)
1818
Automa host: 39/22 (search/found)
1919
Automa domain: 39/0 (search/found)

tests/cfgs/default/result/tor.pcap.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LRU cache zoom: 0/0/0 (insert/search/found)
1111
LRU cache stun: 0/0/0 (insert/search/found)
1212
LRU cache tls_cert: 0/8/0 (insert/search/found)
1313
LRU cache mining: 0/1/0 (insert/search/found)
14-
LRU cache msteams: 0/2/0 (insert/search/found)
14+
LRU cache msteams: 0/1/0 (insert/search/found)
1515
LRU cache stun_zoom: 0/0/0 (insert/search/found)
1616
Automa host: 7/0 (search/found)
1717
Automa domain: 7/0 (search/found)

0 commit comments

Comments
 (0)