Page MenuHomeFreeBSD

ping6: Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC)
ClosedPublic

Authored by jansucan on Aug 12 2019, 11:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 16, 1:25 AM
Unknown Object (File)
Jul 2 2025, 12:32 AM
Unknown Object (File)
Jun 29 2025, 3:01 PM
Unknown Object (File)
Jun 28 2025, 10:54 PM
Unknown Object (File)
Jun 28 2025, 3:08 PM
Unknown Object (File)
Jun 26 2025, 7:48 PM
Unknown Object (File)
Jun 26 2025, 5:52 AM
Unknown Object (File)
Jun 26 2025, 5:24 AM
Subscribers

Details

Summary

Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC)

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

asomers requested changes to this revision.Aug 12 2019, 7:34 PM

Thanks for fixing this. This will be a good change.

sbin/ping6/ping6.c
2218 ↗(On Diff #60673)

You should eliminate this function and use timespecsub(3) instead.

This revision now requires changes to proceed.Aug 12 2019, 7:34 PM

Use timespecsub(3) instead of a private function.

sbin/ping6/ping6.c
2218 ↗(On Diff #60673)

Fixed.

Annotate truncating of time values saved in a packet.

asomers requested changes to this revision.Aug 13 2019, 3:10 PM
asomers added inline comments.
sbin/ping6/ping6.c
1151 ↗(On Diff #60714)

These 10 lines can be replaced by timespecadd.

This revision now requires changes to proceed.Aug 13 2019, 3:10 PM

Use timespecadd(), timespecsub(), and timespecclear().

sbin/ping6/ping6.c
1151 ↗(On Diff #60714)

Fixed.

asomers added inline comments.
sbin/ping6/ping6.c
1151 ↗(On Diff #60714)

Thanks. It's much more readable now.

This revision is now accepted and ready to land.Aug 13 2019, 7:22 PM