From 120e01566a32e1aa4c7c8179165d035c1864cfb3 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sat, 6 Aug 2022 20:01:06 +0200 Subject: Bittorrent: don't use absolute time reference (#1701) --- src/lib/protocols/bittorrent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index e2ad3d2b4..ba88c01e5 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -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); -- cgit v1.2.3