]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
6 years agosocket: add support for socket() flags
Miroslav Lichvar [Tue, 23 Jul 2019 15:26:29 +0000 (17:26 +0200)] 
socket: add support for socket() flags

On start, check if the SOCK_CLOEXEC and SOCK_NONBLOCK flags are
supported in the socket() call and use them instead of fcntl() in order
to reduce the number of system calls required to send a client request.

6 years agosocket: make all sockets non-blocking
Miroslav Lichvar [Tue, 23 Jul 2019 13:09:24 +0000 (15:09 +0200)] 
socket: make all sockets non-blocking

All networking code in chronyd (NTP server/client, signd client, cmdmon
server) assumes sending a message will not block, but only the signd
client actually checks for a write event and only the NTP server
requests a non-blocking socket. The cmdmon server and NTP client
(if using one socket for all servers) might be blocked.

chronyc doesn't need a non-blocking socket, but it is not expected to
block as it sends only one message at a time.

Prefer dropped messages over blocking in all cases. Remove the
SCK_FLAG_NONBLOCK flag and make all sockets non-blocking.

6 years agontp: improve debug messages with port number
Miroslav Lichvar [Thu, 18 Jul 2019 09:33:13 +0000 (11:33 +0200)] 
ntp: improve debug messages with port number

6 years agoutil: move and improve sockaddr-specific functions
Miroslav Lichvar [Thu, 18 Jul 2019 07:42:11 +0000 (09:42 +0200)] 
util: move and improve sockaddr-specific functions

Move the functions to socket.c and improve them to require and check the
sockaddr length.

6 years agoutil: remove UTI_SockaddrToString()
Miroslav Lichvar [Thu, 18 Jul 2019 07:35:59 +0000 (09:35 +0200)] 
util: remove UTI_SockaddrToString()

It is no longer used after the conversions.

6 years agoclient: convert to new socket API
Miroslav Lichvar [Wed, 17 Jul 2019 15:38:32 +0000 (17:38 +0200)] 
client: convert to new socket API

6 years agorefclock: remove SOCK socket on exit
Miroslav Lichvar [Wed, 17 Jul 2019 09:30:11 +0000 (11:30 +0200)] 
refclock: remove SOCK socket on exit

6 years agorefclock: convert SOCK to new socket API
Miroslav Lichvar [Wed, 17 Jul 2019 09:26:28 +0000 (11:26 +0200)] 
refclock: convert SOCK to new socket API

6 years agocmdmon: respond from same address
Miroslav Lichvar [Tue, 16 Jul 2019 15:13:07 +0000 (17:13 +0200)] 
cmdmon: respond from same address

Enable the destination address of received messages in order to respond
from the same address on multihomed hosts.

6 years agocmdmon: convert to new socket API
Miroslav Lichvar [Thu, 18 Jul 2019 06:35:54 +0000 (08:35 +0200)] 
cmdmon: convert to new socket API

6 years agontp: convert to new socket API
Miroslav Lichvar [Thu, 18 Jul 2019 06:35:16 +0000 (08:35 +0200)] 
ntp: convert to new socket API

Rework the NTP I/O code to use the new socket support. There are
differences in debug messages and handling of some errors.

6 years agosocket: add new socket support
Miroslav Lichvar [Thu, 18 Jul 2019 06:26:06 +0000 (08:26 +0200)] 
socket: add new socket support

Add a new file implementing support for opening sockets, sending and
receiving messages with control messages (e.g. addresses, timestamps),
and related operations, which should be simpler to use than the system
functions and allow their features to be reused between different parts
of the chrony code.

It is based on the ntp_io.c and ntp_io_linux.c files. It will be used by
the NTP client/server, cmdmon server, client, and others.

6 years agoutil: add UTI_IPSockAddrToString()
Miroslav Lichvar [Thu, 18 Jul 2019 06:12:33 +0000 (08:12 +0200)] 
util: add UTI_IPSockAddrToString()

This function prints an IPSockAddr. IPv6 addresses are printed in
brackets to separate the address from the port.

6 years agoaddressing: introduce IPSockAddr
Miroslav Lichvar [Thu, 18 Jul 2019 06:05:43 +0000 (08:05 +0200)] 
addressing: introduce IPSockAddr

Rename NTP_Remote_Address to IPSockAddr to make it usable in non-NTP
context and provide NTP_Remote_Address for compatibility. Also, change
the type of port to uint16_t.

6 years agocmdmon: limit rate of all responses
Miroslav Lichvar [Tue, 16 Jul 2019 15:15:03 +0000 (17:15 +0200)] 
cmdmon: limit rate of all responses

Include responses to invalid requests in the rate limiting enabled by
the cmdratelimit directive.

6 years agocmdmon: don't require bound UDP socket
Miroslav Lichvar [Tue, 9 Jul 2019 12:48:42 +0000 (14:48 +0200)] 
cmdmon: don't require bound UDP socket

Don't abort on start when no UDP socket could be opened/bound for
cmdmon. The Unix socket is more important and with the IP_FREEBIND
option this case was not caught anyway.

6 years agoprivops: add assertion for bind address length
Miroslav Lichvar [Tue, 9 Jul 2019 10:28:13 +0000 (12:28 +0200)] 
privops: add assertion for bind address length

6 years agotest: fix building of unit tests
Miroslav Lichvar [Tue, 16 Jul 2019 11:30:05 +0000 (13:30 +0200)] 
test: fix building of unit tests

This fixes commit 1227873b8810ed0f82d4b85a3c19c9562fda0b91.

6 years agodoc: improve chronyd man page
Miroslav Lichvar [Thu, 4 Jul 2019 15:37:54 +0000 (17:37 +0200)] 
doc: improve chronyd man page

6 years agomain: add option to specify minimum log severity level
Miroslav Lichvar [Thu, 4 Jul 2019 14:57:36 +0000 (16:57 +0200)] 
main: add option to specify minimum log severity level

The -L option can be used to disable logging of less severe messages,
e.g informational or warnings.

6 years agologging: refactor enabling of debug messages
Miroslav Lichvar [Tue, 2 Jul 2019 14:18:06 +0000 (16:18 +0200)] 
logging: refactor enabling of debug messages

Reorder the LOGS_Severity enum in order of severity and change the code
to not log/print messages with severity below the specified minimum
instead of having a separate debug level.

6 years agonameserv: request SOCK_DGRAM socktype
Miroslav Lichvar [Wed, 26 Jun 2019 15:17:31 +0000 (17:17 +0200)] 
nameserv: request SOCK_DGRAM socktype

Specify SOCK_DGRAM socktype instead of SOCK_STREAM in hints for
getaddrinfo() as chronyd is (and will mainly be) using the returned
addresses to open UDP sockets. This shouldn't make a difference in
practice, but it might avoid some confusion.

6 years agoconfigure: fix warnings in tests
Miroslav Lichvar [Tue, 18 Jun 2019 14:20:59 +0000 (16:20 +0200)] 
configure: fix warnings in tests

Fix some warnings in configure tests reported by clang and coverity
static analyzer.

6 years agotest: update processing of packet log
Miroslav Lichvar [Tue, 18 Jun 2019 13:41:50 +0000 (15:41 +0200)] 
test: update processing of packet log

Two new fields have been added to the packet log, which broke some
of the simulation tests.

6 years agodoc: update NEWS 3.5
Miroslav Lichvar [Fri, 10 May 2019 10:22:57 +0000 (12:22 +0200)] 
doc: update NEWS

6 years agoupdate copyright years
Miroslav Lichvar [Thu, 9 May 2019 14:55:04 +0000 (16:55 +0200)] 
update copyright years

6 years agodoc: add note about minsamples to FAQ
Miroslav Lichvar [Thu, 9 May 2019 13:49:11 +0000 (15:49 +0200)] 
doc: add note about minsamples to FAQ

6 years agorefclock: remove unnecessary strlen() call
Miroslav Lichvar [Thu, 9 May 2019 13:48:11 +0000 (15:48 +0200)] 
refclock: remove unnecessary strlen() call

6 years agotest: extend 133-hwtimestamp test
Miroslav Lichvar [Thu, 9 May 2019 16:44:03 +0000 (18:44 +0200)] 
test: extend 133-hwtimestamp test

6 years agontp: check value returned by CMSG_FIRSTHDR
Miroslav Lichvar [Thu, 9 May 2019 15:34:53 +0000 (17:34 +0200)] 
ntp: check value returned by CMSG_FIRSTHDR

In NIO_Linux_RequestTxTimestamp(), check the returned pointer and the
length of the buffer before adding the control message. This fixes an
issue reported by the Clang static analyzer.

6 years agontp: check timestamping configuration when SIOCSHWTSTAMP fails
Miroslav Lichvar [Tue, 7 May 2019 16:04:37 +0000 (18:04 +0200)] 
ntp: check timestamping configuration when SIOCSHWTSTAMP fails

With future kernels it may be possible to get, but not set, the HW
timestamping configuration on some specific interfaces like macvlan in
containers. This would require the admin to configure the timestamping
before starting chronyd.

If SIOCSHWTSTAMP failed on an interface, try SIOCGHWTSTAMP to check if
the current configuration matches the expected configuration and allow
the interface to be used for HW timestamping.

6 years agoexamples: remove /var from PIDFile in chronyd.service
Miroslav Lichvar [Mon, 6 May 2019 13:38:16 +0000 (15:38 +0200)] 
examples: remove /var from PIDFile in chronyd.service

Recent systemd versions complain when loading a unit using a PIDFile
that relies on the /var/run -> /run symlink.

6 years agodoc: update NEWS 3.5-pre1
Miroslav Lichvar [Thu, 2 May 2019 09:31:40 +0000 (11:31 +0200)] 
doc: update NEWS

6 years agodoc: add more recommendations for best stability to FAQ
Miroslav Lichvar [Tue, 30 Apr 2019 12:45:23 +0000 (14:45 +0200)] 
doc: add more recommendations for best stability to FAQ

6 years agodoc: update list of contributors
Miroslav Lichvar [Mon, 29 Apr 2019 14:42:44 +0000 (16:42 +0200)] 
doc: update list of contributors

Include all authors from the git repository.

6 years agodoc: simplify acknowledgements in README
Miroslav Lichvar [Mon, 29 Apr 2019 14:22:32 +0000 (16:22 +0200)] 
doc: simplify acknowledgements in README

Stop trying to maintain a list of individual contributions. Just list
the contributors. For tracking individual changes in the source code
there is git.

6 years agodoc: list build requirements in installation
Miroslav Lichvar [Mon, 29 Apr 2019 14:15:06 +0000 (16:15 +0200)] 
doc: list build requirements in installation

6 years agodoc: improve combinelimit description
Miroslav Lichvar [Fri, 26 Apr 2019 09:19:20 +0000 (11:19 +0200)] 
doc: improve combinelimit description

6 years agodoc: improve rtconutc description
Miroslav Lichvar [Fri, 26 Apr 2019 09:12:41 +0000 (11:12 +0200)] 
doc: improve rtconutc description

6 years agotest: use env in shebang of system tests
Miroslav Lichvar [Fri, 26 Apr 2019 08:04:15 +0000 (10:04 +0200)] 
test: use env in shebang of system tests

This should allow the tests to run on systems where bash is not in /bin.

6 years agotest: add 104-systemdirs system test
Miroslav Lichvar [Thu, 25 Apr 2019 16:40:46 +0000 (18:40 +0200)] 
test: add 104-systemdirs system test

6 years agotest: fix owner of driftfile and keys in system tests
Miroslav Lichvar [Thu, 25 Apr 2019 16:18:11 +0000 (18:18 +0200)] 
test: fix owner of driftfile and keys in system tests

6 years agotest: allow separate lib/log/run directories in system tests
Miroslav Lichvar [Thu, 25 Apr 2019 16:19:00 +0000 (18:19 +0200)] 
test: allow separate lib/log/run directories in system tests

6 years agotest: check if non-root user can access test directory
Miroslav Lichvar [Thu, 25 Apr 2019 15:27:31 +0000 (17:27 +0200)] 
test: check if non-root user can access test directory

6 years agotest: redirect error messages in system tests
Miroslav Lichvar [Thu, 25 Apr 2019 15:25:19 +0000 (17:25 +0200)] 
test: redirect error messages in system tests

6 years agotest: allow TEST_DIR and CHRONYC_WRAPPER to be set for system tests
Miroslav Lichvar [Thu, 25 Apr 2019 15:24:37 +0000 (17:24 +0200)] 
test: allow TEST_DIR and CHRONYC_WRAPPER to be set for system tests

6 years agosys_posix: support SCHED_FIFO and mlockall on more OSs
Stefan R. Filipek [Fri, 19 Apr 2019 18:41:14 +0000 (14:41 -0400)] 
sys_posix: support SCHED_FIFO and mlockall on more OSs

Real-time scheduling and memory locking is available on posix compliant
OSs. This patch centralizes this functionality and brings support to
FreeBSD, NetBSD, and Solaris.

[ML: updated coding style]

6 years agorefclock: check all driver options
Miroslav Lichvar [Thu, 18 Apr 2019 13:56:15 +0000 (15:56 +0200)] 
refclock: check all driver options

In each driver provide a list of supported options and abort when an
unknown option is specified in the refclock directive.

6 years agodoc: fix syntax of refclock directive
Miroslav Lichvar [Thu, 18 Apr 2019 10:29:44 +0000 (12:29 +0200)] 
doc: fix syntax of refclock directive

When multiple driver options are specified, they need to be separated by
colon, not comma.

6 years agotest: add system tests
Miroslav Lichvar [Wed, 17 Apr 2019 15:33:16 +0000 (17:33 +0200)] 
test: add system tests

Add a new set of tests for testing basic functionality, starting chronyd
with root privileges on the actual system instead of the simulator.

Tests numbered in the 100-199 range are considered destructive and
intended to be used only on machines dedicated for development or
testing. They are started by the run script only with the -d option.
They may adjust/step the system clock and other clocks, block the RTC,
enable HW timestamping, create SHM segments, etc.

Other tests should not interfere with the system and should work even
when another NTP server/client is running.

6 years agosys_linux: use pthread_setschedparam instead of sched_setscheduler
Stefan R. Filipek [Thu, 4 Apr 2019 23:12:39 +0000 (19:12 -0400)] 
sys_linux: use pthread_setschedparam instead of sched_setscheduler

Fix an issue with Linux and musl libc where sched_setscheduler is not
implemented. It seems that pthread_setschedparam is more widely
supported across different C libraries and OSs. For our use case, it
should make no difference which call is used.

6 years agosys_linux: allow further syscalls in seccomp filter
Vincent Blut [Thu, 14 Mar 2019 23:03:24 +0000 (00:03 +0100)] 
sys_linux: allow further syscalls in seccomp filter

These are needed on arm64.

6 years agosys_linux: allow recv and send in seccomp filter
Leigh Brown [Wed, 13 Mar 2019 16:56:08 +0000 (17:56 +0100)] 
sys_linux: allow recv and send in seccomp filter

6 years agosys_linux: allow waitpid in seccomp filter
Vincent Blut [Thu, 28 Feb 2019 15:43:56 +0000 (16:43 +0100)] 
sys_linux: allow waitpid in seccomp filter

6 years agosys_linux: allow _llseek in seccomp filter
Vincent Blut [Thu, 28 Feb 2019 13:39:13 +0000 (14:39 +0100)] 
sys_linux: allow _llseek in seccomp filter

This is needed on various 32-bit platforms to reposition read/write file
offset on {raw}measurements and statistics log files.

6 years agotest: fix distribution of settings in ntp_core unit test
Miroslav Lichvar [Wed, 20 Feb 2019 09:11:18 +0000 (10:11 +0100)] 
test: fix distribution of settings in ntp_core unit test

6 years agontp: don't use IP_SENDSRCADDR on bound socket
Miroslav Lichvar [Mon, 3 Dec 2018 14:51:54 +0000 (15:51 +0100)] 
ntp: don't use IP_SENDSRCADDR on bound socket

On FreeBSD, sendmsg() fails when IP_SENDSRCADDR specifies a source
address on a socket that is bound to the address. This prevents a server
configured with the bindaddress directive from responding to clients.

Add a new variable to check whether the server IPv4 socket is not bound
before setting the source address.

6 years agosys_linux: add support for PTP_SYS_OFFSET_EXTENDED ioctl
Miroslav Lichvar [Tue, 27 Nov 2018 12:46:37 +0000 (13:46 +0100)] 
sys_linux: add support for PTP_SYS_OFFSET_EXTENDED ioctl

A new ioctl will probably be added in Linux 4.21. It should enable a
significantly more accurate measurement of the offset between PHC and
system clock.

6 years agosys_linux: split reading and processing of PHC samples
Miroslav Lichvar [Tue, 27 Nov 2018 12:39:21 +0000 (13:39 +0100)] 
sys_linux: split reading and processing of PHC samples

6 years agontp: fix transposition with timestamping packet info
Miroslav Lichvar [Mon, 8 Oct 2018 13:54:07 +0000 (15:54 +0200)] 
ntp: fix transposition with timestamping packet info

Don't forget to include the length of the frame check sequence (FCS) in
the RX timestamp transposition when the L2 length of the received packet
is from SCM_TIMESTAMPING_PKTINFO.

This fixes commit 934d4047f12741f4052e35c7975f72c5307b3e68.

6 years agosys_macosx: remove adjtime() check
Bryan Christianson [Mon, 1 Oct 2018 21:40:27 +0000 (10:40 +1300)] 
sys_macosx: remove adjtime() check

Remove the runtime checking of adjtime(). adjtime() was broken in beta
releases of macOS 10.13 but is ok now.

6 years agotest: fix tests to skip when missing required feature
Miroslav Lichvar [Wed, 26 Sep 2018 16:04:09 +0000 (18:04 +0200)] 
test: fix tests to skip when missing required feature

6 years agotest: allow unit tests to be skipped
Miroslav Lichvar [Thu, 27 Sep 2018 07:31:13 +0000 (09:31 +0200)] 
test: allow unit tests to be skipped

6 years agotest: add function for checking config.h in tests
Miroslav Lichvar [Wed, 26 Sep 2018 15:29:23 +0000 (17:29 +0200)] 
test: add function for checking config.h in tests

6 years agotest: include util.h for MIN macro
Miroslav Lichvar [Wed, 26 Sep 2018 16:06:15 +0000 (18:06 +0200)] 
test: include util.h for MIN macro

6 years agonameserv: adopt some include directives from sysincl.h
Miroslav Lichvar [Thu, 20 Sep 2018 13:08:04 +0000 (15:08 +0200)] 
nameserv: adopt some include directives from sysincl.h

Move headers specific to name resolving to nameserv.c. This should hide
the system MIN/MAX macros from the rest of the code.

6 years agohash: include util.h for MIN macro
Miroslav Lichvar [Thu, 20 Sep 2018 13:01:16 +0000 (15:01 +0200)] 
hash: include util.h for MIN macro

The hash_intmd5.c file inadvertently relied on the system headers to
provide the MIN macro, but it is missing with some libc implementations.

6 years agotest: fix Makefile to not create .deps in project root 3.4
Miroslav Lichvar [Wed, 19 Sep 2018 14:33:55 +0000 (16:33 +0200)] 
test: fix Makefile to not create .deps in project root

6 years agodoc: add new question to FAQ
Miroslav Lichvar [Mon, 17 Sep 2018 16:38:46 +0000 (18:38 +0200)] 
doc: add new question to FAQ

6 years agodoc: improve description of minsamples directive
Miroslav Lichvar [Mon, 17 Sep 2018 16:02:36 +0000 (18:02 +0200)] 
doc: improve description of minsamples directive

6 years agotest: add 136-broadcast test
Miroslav Lichvar [Mon, 17 Sep 2018 16:36:04 +0000 (18:36 +0200)] 
test: add 136-broadcast test

6 years agotest: add 012-daemonts test
Miroslav Lichvar [Mon, 17 Sep 2018 16:26:32 +0000 (18:26 +0200)] 
test: add 012-daemonts test

6 years agotest: improve Makefile
Miroslav Lichvar [Thu, 13 Sep 2018 14:29:49 +0000 (16:29 +0200)] 
test: improve Makefile

The -s option of make apparently doesn't work when called from make -C.
Add another filter to ignore the Entering/Leaving messages.

Also, fix a typo.

6 years agotest: include all objects in prerequisites of unit tests
Miroslav Lichvar [Thu, 13 Sep 2018 08:24:06 +0000 (10:24 +0200)] 
test: include all objects in prerequisites of unit tests

6 years agotest: get list of objects from main Makefile
Miroslav Lichvar [Thu, 13 Sep 2018 07:48:15 +0000 (09:48 +0200)] 
test: get list of objects from main Makefile

Instead of linking unit tests with *.o in the root directory, which may
include conflicting objects from a different configuration (e.g. hash),
add a print target to the main Makefile and use it in the unit test
Makefile to link only with objects that are relevant in the current
configuration.

6 years agotest: add 135-ratelimit test
Miroslav Lichvar [Wed, 12 Sep 2018 17:19:11 +0000 (19:19 +0200)] 
test: add 135-ratelimit test

6 years agotest: add 134-log test
Miroslav Lichvar [Wed, 12 Sep 2018 17:04:11 +0000 (19:04 +0200)] 
test: add 134-log test

6 years agotest: extend 110-chronyc test
Miroslav Lichvar [Wed, 12 Sep 2018 15:24:07 +0000 (17:24 +0200)] 
test: extend 110-chronyc test

6 years agogit: update .gitignore
Miroslav Lichvar [Wed, 12 Sep 2018 15:16:17 +0000 (17:16 +0200)] 
git: update .gitignore

6 years agomakefile: remove gcov files and core dumps
Miroslav Lichvar [Wed, 12 Sep 2018 15:13:40 +0000 (17:13 +0200)] 
makefile: remove gcov files and core dumps

6 years agoupdate copyright years
Miroslav Lichvar [Wed, 12 Sep 2018 09:35:27 +0000 (11:35 +0200)] 
update copyright years

6 years agoexamples: drop chrony.spec
Miroslav Lichvar [Wed, 12 Sep 2018 08:51:41 +0000 (10:51 +0200)] 
examples: drop chrony.spec

The example spec file was too limited to be recommended for use in any
rpm-based distribution, e.g. it didn't configure chronyd to drop the
root privileges.

Users that want to build a package from the latest source code should
start with the official package of their distribution.

6 years agoexamples: improve description in chrony.keys example
Miroslav Lichvar [Wed, 12 Sep 2018 08:43:13 +0000 (10:43 +0200)] 
examples: improve description in chrony.keys example

6 years agodoc: warn about permissions in keyfile description
Miroslav Lichvar [Wed, 12 Sep 2018 08:43:01 +0000 (10:43 +0200)] 
doc: warn about permissions in keyfile description

6 years agotest: fix samplefilt unit test to work with low-precision clock
Miroslav Lichvar [Mon, 10 Sep 2018 12:51:30 +0000 (14:51 +0200)] 
test: fix samplefilt unit test to work with low-precision clock

6 years agosamplefilt: use SQUARE macro in SPF_CreateInstance()
Miroslav Lichvar [Mon, 10 Sep 2018 11:20:14 +0000 (13:20 +0200)] 
samplefilt: use SQUARE macro in SPF_CreateInstance()

6 years agoexamples: update chrony.conf example for new default pidfile
Miroslav Lichvar [Mon, 10 Sep 2018 08:37:37 +0000 (10:37 +0200)] 
examples: update chrony.conf example for new default pidfile

6 years agotest: make 129-reload more reliable
Miroslav Lichvar [Fri, 31 Aug 2018 10:48:07 +0000 (12:48 +0200)] 
test: make 129-reload more reliable

6 years agoconfigure: fix compiler warning in pthread test code
Miroslav Lichvar [Fri, 31 Aug 2018 09:04:36 +0000 (11:04 +0200)] 
configure: fix compiler warning in pthread test code

6 years agodoc: update NEWS 3.4-pre1
Miroslav Lichvar [Fri, 31 Aug 2018 08:11:17 +0000 (10:11 +0200)] 
doc: update NEWS

6 years agotest: extend 110-chronyc test
Miroslav Lichvar [Fri, 31 Aug 2018 07:26:45 +0000 (09:26 +0200)] 
test: extend 110-chronyc test

6 years agotest: extend 106-refclock test
Miroslav Lichvar [Fri, 31 Aug 2018 06:42:46 +0000 (08:42 +0200)] 
test: extend 106-refclock test

6 years agodoc: update FAQ
Miroslav Lichvar [Wed, 29 Aug 2018 14:23:42 +0000 (16:23 +0200)] 
doc: update FAQ

6 years agoconfigure: fix detection of timepps.h on NetBSD
Miroslav Lichvar [Thu, 30 Aug 2018 09:43:53 +0000 (11:43 +0200)] 
configure: fix detection of timepps.h on NetBSD

The header requires <time.h> for struct timespec.

6 years agorefclock: fix compiler warning on FreeBSD
Miroslav Lichvar [Thu, 30 Aug 2018 09:32:11 +0000 (11:32 +0200)] 
refclock: fix compiler warning on FreeBSD

6 years agontp: add support for IP_RECVDSTADDR and IP_SENDSRCADDR
Miroslav Lichvar [Thu, 30 Aug 2018 09:15:11 +0000 (11:15 +0200)] 
ntp: add support for IP_RECVDSTADDR and IP_SENDSRCADDR

FreeBSD doesn't support IP_PKTINFO. Instead it provides IP_RECVDSTADDR
and IP_SENDSRCADDR, which can be used to get/set the destination/source
address.

In future IP_RECVIF and IP_SENDIF may be supported to get and set also
the interface.

6 years agontp: set interface index in IP*_PKTINFO when responding
Miroslav Lichvar [Wed, 29 Aug 2018 08:56:14 +0000 (10:56 +0200)] 
ntp: set interface index in IP*_PKTINFO when responding

When a server with multiple interfaces in the same network is sending a
response, setting the ipi_spec_dst/ipi6_addr field of the IP*_PKTINFO
control message selects the source address, but not necessarily the
interface. The packet has the expected source address, but it may be
sent by an interface that doesn't have the address.

Set the ipi_ifindex/ipi6_ifindex field to respond on the same interface
as the request was received from to avoid asymmetries in delay and
timestamping.

6 years agotest: add 133-hwtimestamp test
Miroslav Lichvar [Wed, 29 Aug 2018 16:08:43 +0000 (18:08 +0200)] 
test: add 133-hwtimestamp test

6 years agotest: add 132-logchange test
Miroslav Lichvar [Tue, 28 Aug 2018 16:13:52 +0000 (18:13 +0200)] 
test: add 132-logchange test

6 years agotest: add 131-maxchange test
Miroslav Lichvar [Tue, 28 Aug 2018 16:00:16 +0000 (18:00 +0200)] 
test: add 131-maxchange test