From: Tom Gundersen Date: Mon, 19 May 2014 18:46:54 +0000 (+0200) Subject: timesyncd: only attempt to connect when an address is configured X-Git-Tag: v213~78 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=e56f36380365b5825f0920b0f00a459edc0b2e84 timesyncd: only attempt to connect when an address is configured For now, we accept both link-local and routable addresses, maybe we want to restrict ourselves to routable addresses only. --- diff --git a/TODO b/TODO index 079806536..9a50afbe8 100644 --- a/TODO +++ b/TODO @@ -40,7 +40,6 @@ Features: * timesyncd: - hookup with networkd: NTP servers from dhcp - - hookup with networkd: listen to online/offline state * a way for container managers to turn off getty starting via $container_headless= or so... diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index 6e63e34d8..6dcd942ec 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -1070,7 +1070,7 @@ static bool network_is_online(void) { int r; r = sd_network_get_operational_state(&state); - if (r >= 0 && streq("carrier", state)) + if (r >= 0 && (streq("routable", state) || streq("degraded", state))) return true; else return false;