]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
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

6 years agotest: extend 108-peer test
Miroslav Lichvar [Mon, 27 Aug 2018 12:17:18 +0000 (14:17 +0200)] 
test: extend 108-peer test

6 years agotest: don't override user settings with default values
Miroslav Lichvar [Mon, 27 Aug 2018 11:34:49 +0000 (13:34 +0200)] 
test: don't override user settings with default values

This fixes commit 671daf06b832940bb331242d07462c0f69be9618.

6 years agotest: extend ntp_core unit test
Miroslav Lichvar [Mon, 27 Aug 2018 15:18:20 +0000 (17:18 +0200)] 
test: extend ntp_core unit test

6 years agotest: update hash unit test
Miroslav Lichvar [Mon, 27 Aug 2018 15:32:38 +0000 (17:32 +0200)] 
test: update hash unit test

6 years agotest: enable unit tests to suspend logging
Miroslav Lichvar [Tue, 28 Aug 2018 12:20:40 +0000 (14:20 +0200)] 
test: enable unit tests to suspend logging

6 years agologging: allow reopening stderr
Miroslav Lichvar [Tue, 28 Aug 2018 12:10:21 +0000 (14:10 +0200)] 
logging: allow reopening stderr

LOG_OpenFileLog(NULL) can be now used to reopen stderr.

6 years agologging: close previous file log after opening new one
Miroslav Lichvar [Tue, 28 Aug 2018 12:04:44 +0000 (14:04 +0200)] 
logging: close previous file log after opening new one

Currently, the log is always opened only once, but that will change with
tests temporarily suspending logging.

6 years agontp: optimize MAC truncation
Miroslav Lichvar [Mon, 27 Aug 2018 15:20:56 +0000 (17:20 +0200)] 
ntp: optimize MAC truncation

When generating a MAC for an NTP packet, request only the bytes that
will be sent.

6 years agohash: allow truncated output
Miroslav Lichvar [Mon, 27 Aug 2018 14:26:01 +0000 (16:26 +0200)] 
hash: allow truncated output

Tomcrypt, some NSS hash functions, and the internal MD5 require the
output buffer to be at least as long as the digest. To provide the same
hashing API with all four options, use an extra buffer for the digest
when necessary and copy only the requested bytes to the caller.

6 years agontp: remove unnecessary constant
Miroslav Lichvar [Mon, 27 Aug 2018 12:12:23 +0000 (14:12 +0200)] 
ntp: remove unnecessary constant

6 years agosources: check maximum reach size before postponing update
Miroslav Lichvar [Mon, 27 Aug 2018 11:11:49 +0000 (13:11 +0200)] 
sources: check maximum reach size before postponing update

Don't wait for other sources to be selectable when the maximum
selectable and non-selectable reachability registers happen to match
and a register is already full (e.g. after heavy packet loss).

6 years agodoc: improve description of LastRx column in chronyc sources
Miroslav Lichvar [Mon, 27 Aug 2018 09:26:21 +0000 (11:26 +0200)] 
doc: improve description of LastRx column in chronyc sources

6 years agotest: add 130-quit test
Miroslav Lichvar [Fri, 24 Aug 2018 14:56:09 +0000 (16:56 +0200)] 
test: add 130-quit test

6 years agotest: add 129-reload test
Miroslav Lichvar [Fri, 24 Aug 2018 14:33:20 +0000 (16:33 +0200)] 
test: add 129-reload test

6 years agotest: add 128-nocontrol test
Miroslav Lichvar [Fri, 24 Aug 2018 13:40:12 +0000 (15:40 +0200)] 
test: add 128-nocontrol test

6 years agotest: separate client/server chronyd options
Miroslav Lichvar [Fri, 24 Aug 2018 13:05:58 +0000 (15:05 +0200)] 
test: separate client/server chronyd options

6 years agotest: avoid using eval in shell scripts
Miroslav Lichvar [Fri, 24 Aug 2018 12:56:04 +0000 (14:56 +0200)] 
test: avoid using eval in shell scripts

6 years agotest: extend util unit test
Miroslav Lichvar [Fri, 24 Aug 2018 12:19:40 +0000 (14:19 +0200)] 
test: extend util unit test

6 years agotest: add samplefilt unit test
Miroslav Lichvar [Thu, 23 Aug 2018 15:06:50 +0000 (17:06 +0200)] 
test: add samplefilt unit test

6 years agotest: add sanitizers test
Miroslav Lichvar [Wed, 22 Aug 2018 15:19:16 +0000 (17:19 +0200)] 
test: add sanitizers test

6 years agotest: detect configure errors in compilation test
Miroslav Lichvar [Wed, 22 Aug 2018 13:05:56 +0000 (15:05 +0200)] 
test: detect configure errors in compilation test

6 years agotest: add -Werror to CFLAGS in compilation test
Miroslav Lichvar [Wed, 22 Aug 2018 13:03:59 +0000 (15:03 +0200)] 
test: add -Werror to CFLAGS in compilation test

6 years agodoc: update description of -r option
Miroslav Lichvar [Fri, 24 Aug 2018 14:09:21 +0000 (16:09 +0200)] 
doc: update description of -r option

6 years agosourcestats: improve debug message in SST_GetTrackingData()
Miroslav Lichvar [Fri, 24 Aug 2018 10:43:27 +0000 (12:43 +0200)] 
sourcestats: improve debug message in SST_GetTrackingData()

6 years agosources: use SQUARE macro in combine_sources()
Miroslav Lichvar [Fri, 24 Aug 2018 07:45:00 +0000 (09:45 +0200)] 
sources: use SQUARE macro in combine_sources()

6 years agosamplefilt: check for non-increasing sample times
Miroslav Lichvar [Thu, 23 Aug 2018 12:19:16 +0000 (14:19 +0200)] 
samplefilt: check for non-increasing sample times

Adopt the check from the refclock code to check also samples from NTP.

6 years agotest: update hwclock unit test
Miroslav Lichvar [Tue, 21 Aug 2018 14:50:58 +0000 (16:50 +0200)] 
test: update hwclock unit test

6 years agosys_linux: extend debug message
Miroslav Lichvar [Tue, 21 Aug 2018 11:23:12 +0000 (13:23 +0200)] 
sys_linux: extend debug message

6 years agosys_linux: improve support for upcoming kernel versions
Miroslav Lichvar [Tue, 21 Aug 2018 11:04:21 +0000 (13:04 +0200)] 
sys_linux: improve support for upcoming kernel versions

Starting with Linux 4.19, the frequency of the system clock should be
updated immediately in the system call itself, which will significantly
reduce the maximum delay of the update.

Increase the assumed tick rate in order to reduce the dispersion
accumulated by the driver when it sets the frequency.

6 years agotest: make 121-orphan more reliable
Miroslav Lichvar [Tue, 21 Aug 2018 12:11:30 +0000 (14:11 +0200)] 
test: make 121-orphan more reliable

6 years agoreference: refactor estimation of clock frequency
Miroslav Lichvar [Tue, 21 Aug 2018 10:10:41 +0000 (12:10 +0200)] 
reference: refactor estimation of clock frequency

Reorder code in REF_SetReference(), clean it up a bit, and split off the
parts specific to the weighting and estimation of the new frequency.

6 years agoreference: include skew in local sync status setting
Miroslav Lichvar [Fri, 17 Aug 2018 14:05:47 +0000 (16:05 +0200)] 
reference: include skew in local sync status setting

6 years agosourcestats: include offset SD in tracking root dispersion
Miroslav Lichvar [Fri, 17 Aug 2018 14:05:33 +0000 (16:05 +0200)] 
sourcestats: include offset SD in tracking root dispersion

6 years agoutil: introduce SQUARE macro
Miroslav Lichvar [Fri, 17 Aug 2018 09:16:44 +0000 (11:16 +0200)] 
util: introduce SQUARE macro

6 years agoreference: fix offset SD to include elapsed time
Miroslav Lichvar [Fri, 17 Aug 2018 06:39:30 +0000 (08:39 +0200)] 
reference: fix offset SD to include elapsed time

This should slow down corrections based on old measurements with large
estimated error in frequency.

6 years agosources: fix combined offset SD to include elapsed time
Miroslav Lichvar [Tue, 21 Aug 2018 10:05:12 +0000 (12:05 +0200)] 
sources: fix combined offset SD to include elapsed time

6 years agosources: combine frequencies by variance instead of skew
Miroslav Lichvar [Fri, 17 Aug 2018 08:46:19 +0000 (10:46 +0200)] 
sources: combine frequencies by variance instead of skew

This seems to slightly improve the stability.

6 years agosources: provide frequency SD to reference update
Miroslav Lichvar [Fri, 17 Aug 2018 06:34:14 +0000 (08:34 +0200)] 
sources: provide frequency SD to reference update

6 years agosourcestats: provide frequency SD in tracking data
Miroslav Lichvar [Fri, 17 Aug 2018 06:01:03 +0000 (08:01 +0200)] 
sourcestats: provide frequency SD in tracking data

6 years agosourcestats: replace constant with macro
Miroslav Lichvar [Fri, 17 Aug 2018 05:57:01 +0000 (07:57 +0200)] 
sourcestats: replace constant with macro

6 years agotest: don't require exit message to be on last line
Miroslav Lichvar [Fri, 17 Aug 2018 15:38:44 +0000 (17:38 +0200)] 
test: don't require exit message to be on last line

This is useful with enabled debug output.

6 years agontp: change maxdelay* info messages to use option names
Miroslav Lichvar [Mon, 13 Aug 2018 10:17:57 +0000 (12:17 +0200)] 
ntp: change maxdelay* info messages to use option names