Bug 283256 - CLOCK_MONOTONIC in dhclient
Summary: CLOCK_MONOTONIC in dhclient
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-11 12:52 UTC by Andrey Blochintsev
Modified: 2024-12-11 12:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Blochintsev 2024-12-11 12:52:23 UTC
dhclient uses clock_gettime(CLOCK_MONOTONIC...) to track lease validity.
But CLOCK_MONOTONIC doesn't guarantee any relationship with wall clock. For example clock_monotic starts counting from zero on each reboot of my Freebsd 14.2 in proxmox venv. 

#> cat dhclient.leases.vtnet2 | tail -4
  renew 4 1970/1/1 22:10:57;
  rebind 4 1970/1/1 22:10:52;
  expire 4 1970/1/1 22:11:57;
}


Because of this, saved leases (/var/db/dhclient.leases*) are incorrectly considered usable as backup after a reboot.