Bittorrent: don't use absolute time reference (#1701)

This commit is contained in:
Ivan Nardi
2022-08-06 20:01:06 +02:00
committed by GitHub
parent 1d4e27c473
commit 120e01566a
+1 -1
View File
@@ -522,7 +522,7 @@ static void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_str
u_int32_t ts = ntohl(*((u_int32_t*)&(packet->payload[4])));
u_int32_t now;
now = (u_int32_t)time(NULL);
now = (u_int32_t)(packet->current_time_ms / 1000);
if((ts < (now+86400)) && (ts > (now-86400))) {
bt_proto = ndpi_strnstr((const char *)&packet->payload[20], BITTORRENT_PROTO_STRING, packet->payload_packet_len-20);