Re: [PATCH v2] libpcapng: fix timestamp wrapping in output files

2022-06-01 Thread Thomas Monjalon
17/05/2022 17:15, Stephen Hemminger: > On Tue, 17 May 2022 11:01:15 +0100 > Quentin Armitage wrote: > > > 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

Re: [PATCH v2] libpcapng: fix timestamp wrapping in output files

2022-05-17 Thread Stephen Hemminger
On Tue, 17 May 2022 11:01:15 +0100 Quentin Armitage wrote: > 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.

Re: [PATCH v2] libpcapng: fix timestamp wrapping in output files

2022-05-17 Thread Stephen Hemminger
On Tue, 17 May 2022 11:01:15 +0100 Quentin Armitage wrote: > 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.

[PATCH v2] libpcapng: fix timestamp wrapping in output files

2022-05-17 Thread Quentin Armitage
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")