ntp: cook SO_TIMESTAMP timestamp
This is a partial revert of 8aa9eb19c8
.
With the new generic driver cooking is cheap and it should be slighly
more accurate than reusing offset correction from the scheduler
timestamps.
This commit is contained in:
parent
e9a8503c6b
commit
9913851413
1 changed files with 3 additions and 5 deletions
8
ntp_io.c
8
ntp_io.c
|
@ -472,7 +472,7 @@ read_from_socket(void *anything)
|
||||||
ReceiveBuffer message;
|
ReceiveBuffer message;
|
||||||
union sockaddr_in46 where_from;
|
union sockaddr_in46 where_from;
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
struct timeval now, now_raw;
|
struct timeval now;
|
||||||
double now_err;
|
double now_err;
|
||||||
NTP_Remote_Address remote_addr;
|
NTP_Remote_Address remote_addr;
|
||||||
NTP_Local_Address local_addr;
|
NTP_Local_Address local_addr;
|
||||||
|
@ -483,7 +483,7 @@ read_from_socket(void *anything)
|
||||||
|
|
||||||
assert(initialised);
|
assert(initialised);
|
||||||
|
|
||||||
SCH_GetLastEventTime(&now, &now_err, &now_raw);
|
SCH_GetLastEventTime(&now, &now_err, NULL);
|
||||||
|
|
||||||
iov.iov_base = message.arbitrary;
|
iov.iov_base = message.arbitrary;
|
||||||
iov.iov_len = sizeof(message);
|
iov.iov_len = sizeof(message);
|
||||||
|
@ -554,9 +554,7 @@ read_from_socket(void *anything)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv));
|
memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv));
|
||||||
|
LCL_CookTime(&tv, &now, &now_err);
|
||||||
/* This should be more accurate than LCL_CookTime(&now_raw,...) */
|
|
||||||
UTI_AddDiffToTimeval(&now, &now_raw, &tv, &now);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue