From: Chitoku Date: Wed, 8 Mar 2023 10:52:55 +0000 (+0900) Subject: timesync: stop re-sync on network configuration change when no link servers are confi... X-Git-Tag: v254-rc1~1096 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f9c8d02918492e9369cf85479c2e540b9c1f698;p=thirdparty%2Fsystemd.git 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 e05dd7718d0b32e039c9e0f7bf3875079d1a359d. --- diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index c8d38f212be..b8cc6f4ead6 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -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; }