]> git.droids-corp.org - dpdk.git/commit
pcapng: fix timestamp wrapping in output files
authorQuentin Armitage <quentin@armitage.org.uk>
Tue, 17 May 2022 10:01:15 +0000 (11:01 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 1 Jun 2022 14:39:25 +0000 (16:39 +0200)
commitc882eb544842d94ce06af12b87bb7a4c572b20fb
treeb7794ffa634687fe408a1027b0d40dd3a645ea2b
parentd65c56c44361513fd8319ce278f42275b8a179e3
pcapng: fix timestamp wrapping in output files

In pcap_tsc_to_ns(), delta * NSEC_PER_SEC will overflow approx 8
seconds after pcap_init is called when using a TSC with a frequency
of 2.5GHz.

To avoid the overflow, update the saved time and TSC value once
delta >= tsc_hz.

Fixes: 8d23ce8f5ee ("pcapng: add new library for writing pcapng files")
Cc: stable@dpdk.org
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
lib/pcapng/rte_pcapng.c