timesync: stop re-sync on network configuration change when no link servers are configured (#26708)

This commit fixes an issue where systemd-timesyncd re-synchronizes the
system clock every time the network configuration is updated, no matter
whether link servers are actually changed.

Fixes a bug introduced by e05dd7718d.
This commit is contained in:
Chitoku 2023-03-08 19:52:55 +09:00 committed by GitHub
parent 82c2095a5e
commit 0f9c8d0291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -973,10 +973,10 @@ static int manager_network_read_link_servers(Manager *m) {
assert(m);
r = sd_network_get_ntp(&ntp);
if (r < 0) {
if (r < 0 && r != -ENODATA) {
if (r == -ENOMEM)
log_oom();
else if (r != -ENODATA)
else
log_debug_errno(r, "Failed to get link NTP servers: %m");
goto clear;
}