summaryrefslogtreecommitdiff
path: root/src/timeserver.c
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@linux.intel.com>2012-04-05 13:20:24 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-04-05 18:57:19 +0300
commit920950231d5875220010ed5810593d42b0106dc2 (patch)
tree0f6ccab84657c96482ef02852713dc0092d1e96e /src/timeserver.c
parentfb84de7beb2e06da5e267d397a4f350a2af867d3 (diff)
downloadconnman-920950231d5875220010ed5810593d42b0106dc2.tar.gz
connman-920950231d5875220010ed5810593d42b0106dc2.tar.bz2
connman-920950231d5875220010ed5810593d42b0106dc2.zip
timeservers: Add Fallback Timerservers
Add Fallback timeservers via main.conf. These timeservers are used for time corrections when there are no valid timeservers provided by the user or by the network. The list of timeservers which are queried for timing correction are Timeservers.Configuration (set by the user), service timeservers(via service), gateway, global timeservers (via clock API) and fallback timeservers, in that order.
Diffstat (limited to 'src/timeserver.c')
-rw-r--r--src/timeserver.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/timeserver.c b/src/timeserver.c
index 2558d994..65b7ad03 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -172,6 +172,7 @@ int __connman_timeserver_sync(struct connman_service *default_service)
char **service_ts;
char **service_ts_config;
const char *service_gw;
+ char **fallback_ts;
int index, i;
if (default_service != NULL)
@@ -227,6 +228,12 @@ int __connman_timeserver_sync(struct connman_service *default_service)
for (i=0; timeservers != NULL && timeservers[i] != NULL; i++)
ts_list = g_slist_prepend(ts_list, g_strdup(timeservers[i]));
+ fallback_ts = connman_setting_get_string_list("FallbackTimeservers");
+
+ /* Lastly add the fallback servers */
+ for (i=0; fallback_ts != NULL && fallback_ts[i] != NULL; i++)
+ ts_list = g_slist_prepend(ts_list, g_strdup(fallback_ts[i]));
+
if (ts_list == NULL) {
DBG("No timeservers set.");
return 0;