ntp: add support for software timestamping on Linux

Enable SCM_TIMESTAMPING control messages and the socket's error queue in
order to receive our transmitted packets with a more accurate transmit
timestamp. Add a new file for Linux-specific NTP I/O and implement
processing of these messages there.
This commit is contained in:
Miroslav Lichvar
2016-10-07 17:03:09 +02:00
parent 14c8f07629
commit 997406fe47
7 changed files with 374 additions and 10 deletions

View File

@@ -501,6 +501,9 @@ SYS_Linux_EnableSystemCallFilter(int level)
#endif
{ SOL_SOCKET, SO_BROADCAST }, { SOL_SOCKET, SO_REUSEADDR },
{ SOL_SOCKET, SO_TIMESTAMP }, { SOL_SOCKET, SO_TIMESTAMPNS },
#ifdef HAVE_LINUX_TIMESTAMPING
{ SOL_SOCKET, SO_SELECT_ERR_QUEUE }, { SOL_SOCKET, SO_TIMESTAMPING },
#endif
};
const static int fcntls[] = { F_GETFD, F_SETFD };