Skip to content

Commit

Permalink
One more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seladb authored Aug 14, 2024
1 parent fde2851 commit cde15ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 3rdParty/LightPcapNg/LightPcapNg/src/light_pcapng_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ int light_get_next_packet(light_pcapng_t *pcapng, light_packet_header *packet_he
timestamp += epb->timestamp_low;
uint64_t ticks_per_sec = pcapng->file_info->timestamp_ticks_per_second[epb->interface_id];
uint64_t packet_secs = (ticks_per_sec != 0 ? timestamp / ticks_per_sec : 0);
uint64_t ticks = timestamp % ticks_per_sec;
if (packet_secs <= MAXIMUM_PACKET_SECONDS_VALUE)
if (packet_secs <= MAXIMUM_PACKET_SECONDS_VALUE && packet_secs != 0)
{
uint64_t ticks = timestamp % ticks_per_sec;
packet_header->timestamp.tv_sec = packet_secs;
packet_header->timestamp.tv_nsec = (1000000000ul * ticks) / ticks_per_sec;
}
Expand Down

0 comments on commit cde15ce

Please sign in to comment.