ntp: Calculate transmit time from receive time and monotonic delta
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 25 Sep 2012 10:28:02 +0000 (13:28 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 1 Oct 2012 10:19:17 +0000 (13:19 +0300)
commit1a77cd3c3629dc1008e550716f41c591656c9351
treefec0b46a3a8bbbae368977e4cc268b4e84f70cfc
parent3e3ff223e68bbdaa12b237732230929b6887a305
ntp: Calculate transmit time from receive time and monotonic delta

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.
src/ntp.c