Repaired wrong timestamp calculation.

Fixed incorrect type conversion.
  Hardcoded constant replaced by structure field.
This commit is contained in:
Vitaly Lavrov
2018-04-06 22:56:43 +03:00
parent b63279af8d
commit 025ca46981
+2 -2
View File
@@ -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;