diff options
author | Vitaly Lavrov <vel21ripn@gmail.com> | 2018-04-03 22:41:33 +0300 |
---|---|---|
committer | Vitaly Lavrov <vel21ripn@gmail.com> | 2018-04-06 22:56:43 +0300 |
commit | 025ca469815a97f2ee9ed45378ff2f10f94f5e64 (patch) | |
tree | c402ca2cc0d8e3f73e7cc2a6a97b7f4b9f35ec3e /src/lib/ndpi_main.c | |
parent | b63279af8da009ab9d73ab81d42f0684cc026dce (diff) |
Repaired wrong timestamp calculation.
Fixed incorrect type conversion.
Hardcoded constant replaced by structure field.
Diffstat (limited to 'src/lib/ndpi_main.c')
-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 430f25781..0e861da9f 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -3689,7 +3689,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; @@ -3744,7 +3744,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; |