feat(time-sync): DHCP-provided NTP servers count and are read apart (4.36.0) #105

Merged
christianmanivong merged 2 commits from feat/time-sync-dhcp-ntp-2380 into main 2026-11-11 21:25:28 +00:00
2 Commits
Author SHA1 Message Date
christianmanivong bc47220318 Merge remote-tracking branch 'origin/main' into feat/time-sync-dhcp-ntp-2380
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m34s
driver / test (3.13) (pull_request) Successful in 1m32s
driver / test (3.12) (pull_request) Successful in 1m52s
driver / lowest (pull_request) Successful in 1m3s
driver / build (pull_request) Successful in 48s
driver / security (pull_request) Successful in 1m26s
CI / driver (pull_request) Successful in 3m17s
driver / publish (pull_request) Skipped
# Conflicts:
#	CHANGELOG.md
#	pyproject.toml
2026-11-11 22:21:34 +01:00
christianmanivong ac38c68feb feat(time-sync): DHCP-provided NTP servers count and are read apart
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 31s
driver / types (pull_request) Successful in 1m16s
driver / test (3.13) (pull_request) Successful in 1m29s
driver / test (3.12) (pull_request) Successful in 1m33s
driver / lowest (pull_request) Successful in 41s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Successful in 3m22s
driver / publish (pull_request) Skipped
A device that gets the site's time giver through DHCP option 42 is
aligned (NetOrk/netork#2380): most clients already learn it that way.
4.35.0 switched that off on every write -- chrony's DHCP sourcedir was
commented out, and systemd-timesyncd's link servers failed the verify
step -- and folded DHCP's servers into ntp_servers, so an application
could not tell configured from DHCP-provided servers.

TimeSyncDict gains dhcp_ntp_servers (not required): the servers the
device got by DHCP and uses, in its order; [] for none, absent or None
where the driver cannot tell. ntp_servers keeps only the configured ones.

PosixTimeSyncMixin reads chrony's sources from the DHCP client's
sourcedir (CHRONY_DHCP_DIRS, /run/chrony-dhcp by default) as chronyd
reads them, and systemd-timesyncd's LinkNTPServers; ntpd and OpenNTPD
keep DHCP's servers in a configuration of their own, so there it is
unknown. A chrony write now comments out only server, pool and peer
lines and leaves every sourcedir and the DHCP client's files alone. A
DHCP sourcedir that 4.35.0 commented out behind the mark is given back
on the next write, with a restart, so hosts it aligned hear DHCP again.

Version 4.36.0.
2026-11-11 22:08:52 +01:00