Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Change-Id: I84a42375b5c59739e4caca1f726699ea7647ef17
|
|
|
|
Calculate transmit time used in NTP as the reception time minus
the delta of the monotonic receive and transmit times. When
calculated this way, it does not matter if the time happens to
be set to something else between the sending and receiving of the
NTP packet.
On sending the added monotonic time and the previous transmit time
are saved at the same point in time. On reception the monotonic time
is evaluated after the packet has been received by ConnMan. This is
in contrast to the actual reception wall clock time which is added
by the kernel. The difference between the reception times on a normal
system is about 100µs, which is neglible.
|
|
This patch causes the internal NTP client to retry a given server
address up to three times (four total attempts) at a two second interval
before falling back to another server name or server address.
|
|
This patch uses a mnemonic to specify the request precision and also
adds a comment how a future implementation might pass along the actual
system wall clock precision.
|
|
|
|
Use mnemonics when checking reply flags and print out information in
debug mode about why the reply flags were rejected.
|
|
This patch sets the non-in-sync flag of the leap subfield of the packet
flags field. This reflects behavior implemented by ntpdate or ntpd in
one-shot mode.
|
|
This sets the ntp request packet transmit time to the current system
time to reflect behavior implemented by ntpdate and ntpd in one-shot
mode.
|
|
Convert a magic number into equivalent mnemonics for the flags (leap,
version, mode) packet field.
|
|
|
|
This could happen if the network routes are not yet setup
so the sendto() could fail. In this case try next address and
hope for the best. This is a rare issue but I have seen it
couple of times.
|
|
|
|
|
|
If the NTP server failed to respond, NTP client wait for 16 seconds
before trying the next server. But since now we have the default
gateway as a possible candidate for NTP (which has higher priority over
global timeaservers), there might be a chance that it might fail to
respond to a NTP query (e.g a wifi router without ntp support).
We have to wait for 16 sec, untill NTP switches to the next server.
This seems like a long period, especially if you made timezone changes
and you want the NTP sync to happen asap. Hence reducing this timeout to
5 seconds.
|
|
Add a timeout mechanism to switch to next system timeserver
if the current one does not respond or is a bogus one.
|
|
__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.
|
|
__connman_ntp_start() takes a NTP server IP, and starts querying it for
time correction.If a timeserver responds, we continue to query it every
"Poll Interval" seconds for time corrections.
__connman_ntp_stop() stops the polling process.
|
|
Make sure all file descriptor are closed.
|
|
|