diff options
author | Michele Campus <fci1908@gmail.com> | 2018-04-09 16:44:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-09 16:44:38 +0200 |
commit | 9c1029ff6c577e6eef5f71ab8d88111c2bed2c9d (patch) | |
tree | 4285d611aeec2684bfb257bcb20bf4f92f29eb54 /src | |
parent | 56f14ebee4e689e1932fac24e35bdadc6a16f342 (diff) | |
parent | 025ca469815a97f2ee9ed45378ff2f10f94f5e64 (diff) |
Merge pull request #543 from vel21ripn/fix_packet_time
Repaired wrong timestamp calculation.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 9d04f8630..a8af223d8 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -3691,7 +3691,7 @@ void ndpi_process_extra_packet(struct ndpi_detection_module_struct *ndpi_struct, } flow->packet.tick_timestamp_l = current_tick_l; - flow->packet.tick_timestamp = (u_int32_t)current_tick_l/1000; + flow->packet.tick_timestamp = (u_int32_t)(current_tick_l/ndpi_struct->ticks_per_second); /* parse packet */ flow->packet.iph = (struct ndpi_iphdr *)packet; @@ -3746,7 +3746,7 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct } flow->packet.tick_timestamp_l = current_tick_l; - flow->packet.tick_timestamp = (u_int32_t)current_tick_l/1000; + flow->packet.tick_timestamp = (u_int32_t)(current_tick_l/ndpi_struct->ticks_per_second); /* parse packet */ flow->packet.iph = (struct ndpi_iphdr *)packet; |