Fix endianess in IP-Port lookup

Port parameter in `ndpi_network_port_ptree_match()` must be in network
order.
This commit is contained in:
Nardi Ivan
2022-09-05 10:17:58 +02:00
committed by Toni
parent b7c1030804
commit 95c1daa851
+2 -2
View File
@@ -5523,11 +5523,11 @@ u_int16_t ndpi_guess_host_protocol_id(struct ndpi_detection_module_struct *ndpi_
/* guess host protocol; server first */
addr.s_addr = flow->s_address.v4;
ret = ndpi_network_port_ptree_match(ndpi_str, &addr, ntohs(flow->s_port));
ret = ndpi_network_port_ptree_match(ndpi_str, &addr, flow->s_port);
if(ret == NDPI_PROTOCOL_UNKNOWN) {
addr.s_addr = flow->c_address.v4;
ret = ndpi_network_port_ptree_match(ndpi_str, &addr, ntohs(flow->c_port));
ret = ndpi_network_port_ptree_match(ndpi_str, &addr, flow->c_port);
}
}