mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 04:15:06 -05:00
ntp: fix processing of kernel timestamps on non-Linux systems
When the SO_TIMESTAMP socket option was enabled, the expected type of control messages containing timestamps was SO_TIMESTAMP instead of SCM_TIMESTAMP. This worked on Linux, where the two values are equal, but not on the other supported systems. The timestamps were ignored and this probably worsened the accuracy and stability of the synchronisation.
This commit is contained in:
2
ntp_io.c
2
ntp_io.c
@@ -556,7 +556,7 @@ read_from_socket(void *anything)
|
||||
#endif
|
||||
|
||||
#ifdef SO_TIMESTAMP
|
||||
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SO_TIMESTAMP) {
|
||||
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP) {
|
||||
struct timeval tv;
|
||||
|
||||
memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv));
|
||||
|
||||
Reference in New Issue
Block a user