summaryrefslogtreecommitdiff
path: root/src/timeserver.c
AgeCommit message (Collapse)AuthorFilesLines
2014-07-17Imported Upstream version 1.24upstream/1.24Zhang zhengguang1-33/+34
2013-05-31timeserver: Periodically wake up to recheck timeserversPatrik Flykt1-10/+72
The current situation is that a failed timeserver name resolution removes the timeserver immediately from the list of used timeservers and failing to connect to the nameserver IP address removes the timeserver after a 2 second delay. Currently no mechanism exists to re-create the list of nameservers once the list has been exhausted or the more preferred timeservers have been removed from it. This implementation combats both problems where less used timeservers further away end up being used despite a more optimal closer one becoming available as well as the problem of exhausting the nameserver list. This is done by periodially waking up and checking the timeserver in use. If the timeserver in use is not the most preferred one or the list of timeservers is empty, the timeserver list is recreated and the timeserver polling procedure is restarted.
2013-05-20timeserver: Check the time update methodPatrik Flykt1-0/+3
If the time update method is manual, no NTP time servers are returned.
2012-07-17ntp: Add debug message when starting NTP against resolved serverGrant Erickson1-0/+2
This patch adds an analagous debug message when starting NTP against a resolved server as when starting against a numbered server.
2012-07-17ntp: Fixed a debug message typoGrant Erickson1-1/+1
2012-07-16timeserver: Try all resolved timeserver IP addressesJukka Rissanen1-2/+8
If we get more than one IP address, then add those server addresses to the time server list so that they can be tried if the first entry fails.
2012-06-15timeserver: Get rid of useless and annoying error messageJukka Rissanen1-6/+1
2012-06-14timeserver: Simplify timeserver IP address checkingPatrik Flykt1-11/+1
2012-05-01timeserver: Use helper function to add timeservers only oncePatrik Flykt1-5/+6
2012-05-01timeserver: Helper function for adding timeservers once to a listPatrik Flykt1-0/+17
2012-04-29core: Update copyright informationMarcel Holtmann1-1/+1
2012-04-27ipconfig: Add ipconfig type to __connman_ipconfig_get_gateway_from_index()Patrik Flykt1-1/+2
In order to be able to request a certain ipconfig type, add the type as a parameter to __connman_ipconfig_get_gateway_from_index().
2012-04-24timeserver: Fix NULL network struct access for VPNPatrik Flykt1-7/+7
A VPN does not have a network struct set. Thus do not attempt to look up the corresponding interface index for a NULL network pointer. Fixes BMC#25075
2012-04-20timeserver: Notify service of changed timeserversPatrik Flykt1-0/+2
2012-04-20timeserver: Refactor __connman_timeserver_sync()Patrik Flykt1-44/+49
Factor out code that creates the timeserver list in __connman_timeserver_sync().
2012-04-12timeserver: Nameserver array was not freedJukka Rissanen1-1/+5
2012-04-12timeserver: Timeserver array was not freedJukka Rissanen1-0/+2
2012-04-05timeserver: Check for resolv before accessing itAlok Barsode1-1/+1
In order to cancel any ongoing resolution, check if both resolv and resolv_id are valid.
2012-04-05timeservers: Add Fallback TimerserversAlok Barsode1-0/+7
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.
2012-04-05timeserver: Add Timeservers.Configuration to timeserver listAlok Barsode1-0/+7
Add Timeservers.Configuration timerservers (if any) to the list of timeservers for time correction query. Now the Order is Timeserver.Config (via the user), service timeserver (via DHCP). default gateway (system), global timeservers (via the user).
2012-04-05timeserver: Add service gateway to timeserver listAlok Barsode1-3/+17
Add default service gateway to the timeserver query list. Now the list is service timeservers (via DHCP), gateway and global timeservers, in that order.
2012-04-05timeserver: Create timeserver listAlok Barsode1-82/+119
Create a timeserver list for NTP query. This list consists of timeserver provided via DHCP and the ones set by user in that order. We recreate this list everytime the default service changes or one of the timeserver values change. Use getaddrinfo to determine if the timeserver is a domain name or a IP address.
2012-04-05timeserver: Trigger ntp on default changed notifierAlok Barsode1-2/+30
Trigger NTP sync on default service going to READY/ONLINE state instead of triggering NTP sync on ONLINE state only. This makes sense for local ntp servers even if the wispr check fails.
2012-04-05Replace older system timeserver values with new ones instead of appendingAlok Barsode1-92/+1
Fixes BMC#24997.
2012-02-04timeserver: Remove connman_timeserver_driver frameworkAlok Barsode1-47/+0
2012-02-04timeserver: Remove connman_timeserver_[append/remove]Alok Barsode1-68/+0
We do not need to these anymore as we directly use the timeservers from service.
2012-02-04timeserver: Check condition to restart timeserversAlok Barsode1-0/+4
if we are using service timeservers, then do not restart ntp if the user modifies system timeservers.
2012-02-04timeserver: Use service timeserver, if any, before system timeserversAlok Barsode1-0/+11
2012-02-04ntp: Add timeserver switch logicAlok Barsode1-1/+3
Add a timeout mechanism to switch to next system timeserver if the current one does not respond or is a bogus one.
2012-02-04Add __connman_timerserver_sync() to resolve a list of timeserversAlok Barsode1-9/+133
__connman_timerserver_sync() resolves system timeservers one at a time and queries the resolved server or the 1st of the resolved servers for time correction. If the resolution fails it resolves the next one. __connman_timerserver_sync_next() resolves the next system timeserver. __connman_timerserver_stop() stops this query.If the user modifies the system timeserver list, we restart the ntp process.
2012-02-04timeserver: Add functions to store/restore timeservers via the clock APIAlok Barsode1-0/+147
2011-06-16element: Remove element.cDaniel Wagner1-0/+2
2011-03-17timeserver: Fix memory leakDaniel Wagner1-0/+2
Reported by: DJ Cozatt <ygdrasil@comcast.net>
2010-06-01Fix timeserver APISamuel Ortiz1-4/+11
We want to keep the server pointer constant.
2010-05-31Complete timeserver APISamuel Ortiz1-5/+62
The timeserver API now includes a sync() call in order to separate timeserver peer addition from actual time syncing.
2010-01-01Update copyright informationMarcel Holtmann1-1/+1
2009-12-14Add framework for handling time serversMarcel Holtmann1-0/+105