mirror of
https://github.com/opnsense/src.git
synced 2026-04-24 07:37:25 -04:00
Until July 2024, dhclient kept track of time as seconds-since-epoch as
a time_t. This was a problem because (a) we wanted sub-second timeouts
and (b) timeouts didn't always do the right thing if the system clock
changed.
Switching to using CLOCK_MONOTONIC and struct timespec fixed those
issues but introduced a new problem: CLOCK_MONOTONIC values were being
intepreted as seconds-since-epoch and written to the dhclient.leases
file, causing confusion with DHCP leases expiring in early 1970.
Attempt to compromise between these by keeping track of both times;
any type within dhclient which is a time_t now refers to seconds past
the epoch, while any struct timespec value is a CLOCK_MONOTONIC time.
PR: 283256
Reviewed by: dch
Fixes: f0a38976b01e ("dhclient: Use clock_gettime() instead of time()")
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D49720
(cherry picked from commit 43d19e6a4c42ade0f276ceca18a09e2e3829fce4)
|
||
|---|---|---|
| .. | ||
| tests | ||
| alloc.c | ||
| bpf.c | ||
| clparse.c | ||
| conflex.c | ||
| convert.c | ||
| dhclient-script | ||
| dhclient-script.8 | ||
| dhclient.8 | ||
| dhclient.c | ||
| dhclient.conf | ||
| dhclient.conf.5 | ||
| dhclient.leases.5 | ||
| dhcp-options.5 | ||
| dhcp.h | ||
| dhcpd.h | ||
| dhctoken.h | ||
| dispatch.c | ||
| errwarn.c | ||
| hash.c | ||
| inet.c | ||
| Makefile | ||
| Makefile.depend | ||
| Makefile.depend.options | ||
| options.c | ||
| packet.c | ||
| parse.c | ||
| privsep.c | ||
| privsep.h | ||
| tables.c | ||
| tree.c | ||
| tree.h | ||