This makes connman use the NTP Pool project's NTP servers
({0..3}.connman.pool.ntp.org) as the default FallbackTimeservers
settings.

More information about the NTP Pool can be found at
http://www.pool.ntp.org/en/.
---
 doc/connman.conf.5 |  3 ++-
 src/main.c         | 13 +++++++++++++
 src/main.conf      |  5 +++--
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/doc/connman.conf.5 b/doc/connman.conf.5
index 626edfd..3754e7c 100644
--- a/doc/connman.conf.5
+++ b/doc/connman.conf.5
@@ -58,7 +58,8 @@ List of Fallback timeservers separated by ",".
 These timeservers are used for NTP sync when there are
 no timeserver set by the user or by the service.
 These can contain mixed combination of fully qualified
-domain names, IPv4 and IPv6 addresses.
+domain names, IPv4 and IPv6 addresses. By default, the
+NTP Pool project is used (http://www.pool.ntp.org).
 .TP
 .B FallbackNameservers=\fPserver1,server2,...\fP
 List of fallback nameservers separated by "," appended
diff --git a/src/main.c b/src/main.c
index 1c17991..74ca4b4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -60,6 +60,14 @@ static char *default_blacklist[] = {
        NULL
 };
 
+static char *default_timeservers[] = {
+       "0.connman.pool.ntp.org",
+       "1.connman.pool.ntp.org",
+       "2.connman.pool.ntp.org",
+       "3.connman.pool.ntp.org",
+       NULL
+};
+
 static struct {
        bool bg_scan;
        char **pref_timeservers;
@@ -244,6 +252,8 @@ static void parse_config(GKeyFile *config)
                        parse_service_types(default_auto_connect, 3);
                connman_settings.blacklisted_interfaces =
                        g_strdupv(default_blacklist);
+               connman_settings.pref_timeservers =
+                       g_strdupv(default_timeservers);
                return;
        }
 
@@ -260,6 +270,9 @@ static void parse_config(GKeyFile *config)
                                        CONF_PREF_TIMESERVERS, NULL, &error);
        if (!error)
                connman_settings.pref_timeservers = timeservers;
+       else
+               connman_settings.pref_timeservers =
+                       g_strdupv(default_timeservers);
 
        g_clear_error(&error);
 
diff --git a/src/main.conf b/src/main.conf
index 93c7a50..54314e6 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -24,8 +24,9 @@
 # These timeservers are used for NTP sync when there are
 # no timeserver set by the user or by the service.
 # These can contain mixed combination of fully qualified
-# domain names, IPv4 and IPv6 addresses.
-# FallbackTimeservers =
+# domain names, IPv4 and IPv6 addresses. By default, the
+# NTP Pool project is used (http://www.pool.ntp.org).
+# FallbackTimeservers = 0.connman.pool.ntp.org, 1.connman.pool.ntp.org, 
2.connman.pool.ntp.org, 3.connman.pool.ntp.org
 
 # List of fallback nameservers separated by "," used if no
 # nameservers are otherwise provided by the service. The
-- 
2.1.0

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to