]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync: stop re-sync on network configuration change when no link servers are confi...
authorChitoku <chitoku-k@users.noreply.github.com>
Wed, 8 Mar 2023 10:52:55 +0000 (19:52 +0900)
committerGitHub <noreply@github.com>
Wed, 8 Mar 2023 10:52:55 +0000 (19:52 +0900)
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.

src/timesync/timesyncd-manager.c

index c8d38f212be47bd7aafa22f7f8048900efcfd8f3..b8cc6f4ead6c61a01cd0a34751f6dc7cc255cddf 100644 (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;
         }