]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
8 years agocmdmon: report offset after manual timestamp as float
Miroslav Lichvar [Tue, 25 Jul 2017 08:53:48 +0000 (10:53 +0200)] 
cmdmon: report offset after manual timestamp as float

Modify the protocol to report the offset as seconds in floating point
instead of integer number of centiseconds.

8 years agomanual: handle failed robust regression
Miroslav Lichvar [Tue, 25 Jul 2017 07:31:04 +0000 (09:31 +0200)] 
manual: handle failed robust regression

8 years agoutil: avoid undefined behavior in timestamp conversion
Miroslav Lichvar [Mon, 24 Jul 2017 13:42:27 +0000 (15:42 +0200)] 
util: avoid undefined behavior in timestamp conversion

8 years agoclient: avoid undefined bit shifts
Miroslav Lichvar [Mon, 24 Jul 2017 11:24:17 +0000 (13:24 +0200)] 
client: avoid undefined bit shifts

8 years agoregress: avoid undefined behavior in pointer arithmetic
Miroslav Lichvar [Fri, 21 Jul 2017 15:13:24 +0000 (17:13 +0200)] 
regress: avoid undefined behavior in pointer arithmetic

8 years agontp: simplify get_poll_adj()
Miroslav Lichvar [Fri, 21 Jul 2017 14:25:47 +0000 (16:25 +0200)] 
ntp: simplify get_poll_adj()

8 years agosourcestats: increase number of samples needed to check delay
Miroslav Lichvar [Fri, 21 Jul 2017 13:02:49 +0000 (15:02 +0200)] 
sourcestats: increase number of samples needed to check delay

Require at least 6 samples to check the increase in the delay of a new
sample to make it more reliable.

8 years agontp: don't accumulate old samples in interleaved client mode
Miroslav Lichvar [Fri, 21 Jul 2017 10:16:21 +0000 (12:16 +0200)] 
ntp: don't accumulate old samples in interleaved client mode

Check how many responses were missing before accumulating a sample using
old timestamps to avoid correcting the clock with an offset extrapolated
over a long interval.

This should be eventually done in sourcestats for all sources.

8 years agontp: revert reversed poll tracking in interleaved mode
Miroslav Lichvar [Fri, 21 Jul 2017 08:55:06 +0000 (10:55 +0200)] 
ntp: revert reversed poll tracking in interleaved mode

With the new selection of timestamps in the interleaved mode it's no
longer necessary to reverse the poll tracking in order to reduce the
local and remote intervals of measurements that makes the peer with
higher stratum.

This reverts commit 4a24368763cdeacc056a29dc27e0e506bd915133.

8 years agontp: select timestamps in interleaved mode
Miroslav Lichvar [Fri, 21 Jul 2017 08:45:46 +0000 (10:45 +0200)] 
ntp: select timestamps in interleaved mode

Use previous local TX and remote RX timestamps for the new sample in the
interleaved mode if it will make the local and remote intervals
significantly shorter in order to improve the accuracy of the measured
delay.

8 years agontp: refactor timestamp selection and interval calculation
Miroslav Lichvar [Fri, 21 Jul 2017 08:17:42 +0000 (10:17 +0200)] 
ntp: refactor timestamp selection and interval calculation

Prepare the code for a third option in the timestamp selection and clean
it up a bit.

8 years agontp: add function for zeroing local timestamps
Miroslav Lichvar [Fri, 21 Jul 2017 07:12:31 +0000 (09:12 +0200)] 
ntp: add function for zeroing local timestamps

8 years agontp: fix poll in source report
Miroslav Lichvar [Fri, 14 Jul 2017 16:11:49 +0000 (18:11 +0200)] 
ntp: fix poll in source report

The source report used the local interval, which in symmetric mode may
be longer than the actual interval used for transmission.

8 years agontp: ignore saved remote poll when peer is not responding
Miroslav Lichvar [Fri, 14 Jul 2017 10:43:26 +0000 (12:43 +0200)] 
ntp: ignore saved remote poll when peer is not responding

When a peer stops responding, allow our actual polling interval to be
longer than poll saved from the last valid response.

8 years agontp: reset TX counter on all valid responses
Miroslav Lichvar [Fri, 14 Jul 2017 10:04:38 +0000 (12:04 +0200)] 
ntp: reset TX counter on all valid responses

Also change it to an unsigned type.

8 years agoconfigure: fix compiler warning in getrandom() test
Miroslav Lichvar [Fri, 14 Jul 2017 08:21:31 +0000 (10:21 +0200)] 
configure: fix compiler warning in getrandom() test

8 years agoconfigure: check for hardening compiler options
Miroslav Lichvar [Thu, 13 Jul 2017 12:13:01 +0000 (14:13 +0200)] 
configure: check for hardening compiler options

If no CFLAGS are specified, check if common security hardening options
are supported and add them to the CFLAGS/LDFLAGS. These are typically
enabled in downstream packages, but users compiling chrony from sources
with default CFLAGS should get hardened binaries too.

8 years agosys_macosx: add support for ntp_adjtime() on macOS 10.13+
Bryan Christianson [Thu, 13 Jul 2017 00:18:02 +0000 (12:18 +1200)] 
sys_macosx: add support for ntp_adjtime() on macOS 10.13+

macOS 10.13 will implement the ntp_adjtime() system call, allowing
better control over the system clock than is possible with the existing
adjtime() system call. chronyd will support both the older and newer
calls, enabling binary code to run without recompilation on macOS 10.9
through macOS 10.13.

Early releases of macOS 10.13 have a very buggy adjtime() call. The
macOS driver tests adjtime() to see if the bug has been fixed. If the
bug persists then the timex driver is invoked otherwise the netbsd
driver.

8 years agomain: don't require root privileges with -Q option
Miroslav Lichvar [Wed, 12 Jul 2017 16:38:44 +0000 (18:38 +0200)] 
main: don't require root privileges with -Q option

If the -Q option is specified, disable by default pidfile, ntpport,
cmdport, Unix domain command socket, and clock control, in order to
allow starting chronyd without root privileges and/or when another
chronyd instance is already running.

8 years agontp: define NTP port for configuration code
Miroslav Lichvar [Wed, 12 Jul 2017 16:12:32 +0000 (18:12 +0200)] 
ntp: define NTP port for configuration code

8 years agomain: refactor check of pidfile
Miroslav Lichvar [Wed, 12 Jul 2017 15:30:19 +0000 (17:30 +0200)] 
main: refactor check of pidfile

8 years agosys_timex: fix update of TAI offset on non-Linux systems
Miroslav Lichvar [Mon, 10 Jul 2017 13:51:06 +0000 (15:51 +0200)] 
sys_timex: fix update of TAI offset on non-Linux systems

The tai field in struct timex is a Linux-specific feature. It's possible
to read the current offset with ntp_gettime() (or ntp_gettimex() on
Linux), but apparently not all libc implementations support it.

Rework the code to save and adjust the last value instead of reading
the current value from the kernel.

8 years agosys_timex: rename status variable
Miroslav Lichvar [Mon, 10 Jul 2017 12:48:47 +0000 (14:48 +0200)] 
sys_timex: rename status variable

8 years agontp: fix debug message about unknown HW timestamping ifindex
Miroslav Lichvar [Fri, 30 Jun 2017 13:39:10 +0000 (15:39 +0200)] 
ntp: fix debug message about unknown HW timestamping ifindex

8 years agontp: reverse poll tracking in interleaved symmetric mode
Miroslav Lichvar [Fri, 30 Jun 2017 13:18:40 +0000 (15:18 +0200)] 
ntp: reverse poll tracking in interleaved symmetric mode

Unlike in the basic mode, the peer with a higher stratum needs to wait
for a response before sending the next request in order to minimize the
delay of the measurement and error in the measured delay.

Slightly increase the delay adjustment to make it work with older chrony
versions.

8 years agontp: fix poll interleaving with unsynchronised peers
Miroslav Lichvar [Fri, 30 Jun 2017 09:32:19 +0000 (11:32 +0200)] 
ntp: fix poll interleaving with unsynchronised peers

Update the remote poll and remote stratum even for unsychronised peers,
and handle stratum of 0 as 16, so the peers work with the opposite
differences between their strata and can adjust their polling intervals
in order to interleave the packets.

8 years agohwclock: decrease tolerance of robust regression to 0.1 ppb
Miroslav Lichvar [Fri, 30 Jun 2017 07:40:06 +0000 (09:40 +0200)] 
hwclock: decrease tolerance of robust regression to 0.1 ppb

8 years agoreference: get TAI-UTC offset from leap second timezone
Miroslav Lichvar [Thu, 29 Jun 2017 15:56:16 +0000 (17:56 +0200)] 
reference: get TAI-UTC offset from leap second timezone

Use the timezone specified by the leapsectz directive to get the
current TAI-UTC offset and set the offset of the system clock in order
to provide correct TAI time to applications using ntp_adjtime(),
ntp_gettime(), or clock_gettime(CLOCK_TAI).

8 years agosys_timex: add support for setting TAI-UTC offset
Miroslav Lichvar [Thu, 29 Jun 2017 13:16:20 +0000 (15:16 +0200)] 
sys_timex: add support for setting TAI-UTC offset

8 years agolocal: add support for setting TAI-UTC offset
Miroslav Lichvar [Thu, 29 Jun 2017 13:14:16 +0000 (15:14 +0200)] 
local: add support for setting TAI-UTC offset

8 years agoreference: move static tz variables to function using them
Miroslav Lichvar [Thu, 29 Jun 2017 10:39:42 +0000 (12:39 +0200)] 
reference: move static tz variables to function using them

8 years agoclient: check IP address family before printing as refid
Miroslav Lichvar [Wed, 28 Jun 2017 12:05:41 +0000 (14:05 +0200)] 
client: check IP address family before printing as refid

8 years agoconfigure: add missing object for PHC refclock
Miroslav Lichvar [Tue, 27 Jun 2017 12:41:49 +0000 (14:41 +0200)] 
configure: add missing object for PHC refclock

This fixes commit eceb8d99371a129ad6e11f483a0442d97a895b19.

8 years agotest: add regress unit test
Miroslav Lichvar [Tue, 27 Jun 2017 10:39:00 +0000 (12:39 +0200)] 
test: add regress unit test

8 years agotest: fix crash when printing debug messages
Miroslav Lichvar [Mon, 26 Jun 2017 16:35:57 +0000 (18:35 +0200)] 
test: fix crash when printing debug messages

This fixes commit 6cbeb107db8f687c6c2298b1d8a6240e4da31116.

8 years agosourcestats: use median distance in weight calculation
Miroslav Lichvar [Mon, 26 Jun 2017 11:54:48 +0000 (13:54 +0200)] 
sourcestats: use median distance in weight calculation

Replace mean distance with median distance in the weight calculation.
This should make the weights less sensitive to outliers.

8 years agoregress: provide function to find median
Miroslav Lichvar [Wed, 21 Jun 2017 17:11:10 +0000 (19:11 +0200)] 
regress: provide function to find median

8 years agoregress: reduce maximum number of points to 64
Miroslav Lichvar [Tue, 27 Jun 2017 11:27:32 +0000 (13:27 +0200)] 
regress: reduce maximum number of points to 64

This corresponds to the maximum number of points used by regress users.

8 years agoregress: use chars instead of ints for flags
Miroslav Lichvar [Thu, 22 Jun 2017 16:32:25 +0000 (18:32 +0200)] 
regress: use chars instead of ints for flags

This reduces the size of the flags array on stack.

8 years agoregress: fix assertion in robust regression
Miroslav Lichvar [Tue, 27 Jun 2017 11:26:39 +0000 (13:26 +0200)] 
regress: fix assertion in robust regression

8 years agoregress: speed up range expansion in robust regression
Miroslav Lichvar [Tue, 27 Jun 2017 08:03:05 +0000 (10:03 +0200)] 
regress: speed up range expansion in robust regression

Instead of repeatedly expanding the range of b with the same increment,
double the range on each iteration to speed up the expansion. Also, add
a sanity check for the interval.

8 years agoregress: fix robust regression
Miroslav Lichvar [Thu, 22 Jun 2017 13:35:37 +0000 (15:35 +0200)] 
regress: fix robust regression

The bisection always terminated after one iteration. Change the code to
check if the middle is different from the lower and upper limits as
suggested in the original recipe.

This fixes commit b14689d59b06ec21a9e079c65a0882b7bf457448.

8 years agosourcestats: include precision in weight calculation
Miroslav Lichvar [Wed, 21 Jun 2017 15:48:26 +0000 (17:48 +0200)] 
sourcestats: include precision in weight calculation

In order to stabilize the weights of refclock samples which have only
slightly different distances, don't allow the stddev value used in the
weight calculation to be smaller than the precision and also assign
weight of 1 to all samples which have distance < minimum + precision.

8 years agoconf: abort when include directive fails
Miroslav Lichvar [Tue, 20 Jun 2017 15:43:26 +0000 (17:43 +0200)] 
conf: abort when include directive fails

When parsing the include directive, call glob() with the GLOB_ERR and
GLOB_NOMAGIC flags, and abort with an error message when matching of the
pattern failed with other error than GLOB_NOMATCH.

This restores the original behavior of the directive when it didn't
allow patterns, but it will still not fail with patterns not matching
any files in an existing directory.

8 years agorefclock: set default precision to precision of system clock
Miroslav Lichvar [Fri, 16 Jun 2017 11:39:01 +0000 (13:39 +0200)] 
refclock: set default precision to precision of system clock

8 years agontp: suggest clients to increase their polling interval
Miroslav Lichvar [Fri, 16 Jun 2017 10:16:17 +0000 (12:16 +0200)] 
ntp: suggest clients to increase their polling interval

When the poll value in a client request is smaller than the server's NTP
rate limiting interval, set poll in the response to the rate limiting
interval to suggest the client to increase its polling interval.

This follows ntpd as a server. No current client implementation seems to
be increasing its interval by the poll, but it may change in the future.

8 years agoutil: add support for getrandom()
Miroslav Lichvar [Thu, 15 Jun 2017 15:35:33 +0000 (17:35 +0200)] 
util: add support for getrandom()

Add support for the Linux getrandom() system call, which is available
in glibc since 2.25.

8 years agontp: apply HW TX/RX compensation to system time
Miroslav Lichvar [Thu, 15 Jun 2017 09:16:57 +0000 (11:16 +0200)] 
ntp: apply HW TX/RX compensation to system time

Apply the compensation to the cooked local time instead of HW time. This
might make a difference when the HW clock has a large frequency error.

8 years agodoc: update description of hwtimestamp directive
Miroslav Lichvar [Wed, 14 Jun 2017 11:18:11 +0000 (13:18 +0200)] 
doc: update description of hwtimestamp directive

8 years agontp: add option to select HW RX timestamping filter
Miroslav Lichvar [Tue, 6 Jun 2017 15:20:03 +0000 (17:20 +0200)] 
ntp: add option to select HW RX timestamping filter

Add an rxfilter option to the hwtimestamp directive to select which
received packets should be timestamped. It can be set to "none", "ntp",
or "all". The default value is ntp, which falls back to all when ntp is
not supported.

8 years agontp: add support for new Linux timestamping options
Miroslav Lichvar [Tue, 6 Jun 2017 15:07:45 +0000 (17:07 +0200)] 
ntp: add support for new Linux timestamping options

New timestamping options may be available in kernel 4.13. They can be
used to get the index of the interface which timestamped incoming packet
together with its length at layer 2, enable simultaneous SW and HW TX
timestamping, and enable a new RX filter for NTP packets.

8 years agontp: always try to enable SW timestamping on Linux
Miroslav Lichvar [Mon, 5 Jun 2017 16:47:05 +0000 (18:47 +0200)] 
ntp: always try to enable SW timestamping on Linux

Request SW timestamps with SCM_TIMESTAMPING even if HW timestamping is
enabled. This replaces SCM_TIMESTAMP(NS) for RX and enables TX SW
timestamping on interfaces that don't support HW timestamping (or don't
have it enabled) if another interface has HW timestamping enabled.

8 years agomain: close logs as last thing before exit
Miroslav Lichvar [Fri, 26 May 2017 10:50:47 +0000 (12:50 +0200)] 
main: close logs as last thing before exit

This should prevent losing messages from other finalisation code.

8 years agoclient: try to connect to all addresses before giving up
Miroslav Lichvar [Thu, 25 May 2017 14:12:50 +0000 (16:12 +0200)] 
client: try to connect to all addresses before giving up

Don't give up when one of the addresses/hostnames specified by -h fails
to resolve in DNS_Name2IPAddress(), e.g. with the default setting try to
connect to ::1 even when 127.0.0.1 failed due to the -6 option.

8 years agoclient: use getopt() for command line parsing
Miroslav Lichvar [Thu, 25 May 2017 14:02:41 +0000 (16:02 +0200)] 
client: use getopt() for command line parsing

8 years agomain: use getopt() for command line parsing
Miroslav Lichvar [Thu, 25 May 2017 12:16:31 +0000 (14:16 +0200)] 
main: use getopt() for command line parsing

This allows multiple options to be specified together and also may
options follow configuration directives on systems where getopt()
permutates the arguments.

8 years agodoc: fix typo in chronyd man page
Miroslav Lichvar [Wed, 24 May 2017 14:05:14 +0000 (16:05 +0200)] 
doc: fix typo in chronyd man page

8 years agomain: add option to specify log file
Miroslav Lichvar [Wed, 24 May 2017 14:03:39 +0000 (16:03 +0200)] 
main: add option to specify log file

Add -l option to log to a file instead of syslog or terminal.

8 years agologging: allow logging to file instead of syslog
Miroslav Lichvar [Wed, 24 May 2017 13:38:43 +0000 (15:38 +0200)] 
logging: allow logging to file instead of syslog

8 years agomain: use LOG_FATAL to print error when UID is not zero
Miroslav Lichvar [Wed, 24 May 2017 13:11:33 +0000 (15:11 +0200)] 
main: use LOG_FATAL to print error when UID is not zero

8 years agosourcestats: handle negative elapsed time in SST_GetSelectionData()
Miroslav Lichvar [Wed, 24 May 2017 11:50:39 +0000 (13:50 +0200)] 
sourcestats: handle negative elapsed time in SST_GetSelectionData()

Source selection uses the last event time as current time. If it was
called from a refclock which generates a sample in its poll function
(e.g. PHC), the sample time may be later than the event time. This
gives a negative elapsed time in SST_GetSelectionData() and possibly
also a negative root distance, which causes the source to be rejected as
a falseticker.

Use absolute value of the difference in order to always get a positive
root distance.

8 years agodoc: update refclock documentation
Miroslav Lichvar [Mon, 22 May 2017 17:05:22 +0000 (19:05 +0200)] 
doc: update refclock documentation

8 years agorefclock: add option to filter wrong pulse edges
Miroslav Lichvar [Fri, 19 May 2017 16:51:03 +0000 (18:51 +0200)] 
refclock: add option to filter wrong pulse edges

Add width option to the refclock directive to set expected width of
pulses in a PPS signal. The width adds a limit for the maximum offset
and root distance in order to reject PPS samples from wrong events, e.g.
PHCs which cannot be configured to timestamp only rising of falling
edges.

8 years agorefclock_phc: add support for timestamping of external PPS
Miroslav Lichvar [Fri, 5 May 2017 14:07:34 +0000 (16:07 +0200)] 
refclock_phc: add support for timestamping of external PPS

Add extpps driver option to the PHC refclock to enable external
timestamping of PPS signal and also options to configure the channel and
pin index. In this mode, the driver polling function accumulates samples
for hwclock, which is used to convert received timestamping events to
local time.

8 years agosys_linux: add support for external PHC timestamping
Miroslav Lichvar [Fri, 5 May 2017 11:43:11 +0000 (13:43 +0200)] 
sys_linux: add support for external PHC timestamping

8 years agorefclock: add option to treat non-PPS refclocks as PPS
Miroslav Lichvar [Thu, 11 May 2017 11:58:17 +0000 (13:58 +0200)] 
refclock: add option to treat non-PPS refclocks as PPS

Add pps option to the refclock directive to force chronyd to treat any
refclock as a PPS refclock. This is intended for refclocks that may
provide time off by a whole number of seconds due to missing or wrong
TAI/GPS->UTC conversion.

8 years agorefclock: allow all drivers to provide PPS samples
Miroslav Lichvar [Wed, 10 May 2017 15:47:55 +0000 (17:47 +0200)] 
refclock: allow all drivers to provide PPS samples

8 years agorefclock: allow drivers to provide cooked PPS samples
Miroslav Lichvar [Wed, 10 May 2017 15:36:02 +0000 (17:36 +0200)] 
refclock: allow drivers to provide cooked PPS samples

Split RCL_AddPulse() in order to provide a new function for refclock
drivers which can make PPS samples without having raw system time, e.g.
from PHC timestamps.

8 years agorefclock: don't require raw time in valid_sample_time()
Miroslav Lichvar [Wed, 10 May 2017 14:14:03 +0000 (16:14 +0200)] 
refclock: don't require raw time in valid_sample_time()

This makes the check a bit more expensive, but it will be needed to
allow refclocks that don't have raw system time.

8 years agontp: include local error in hwclock samples
Miroslav Lichvar [Tue, 9 May 2017 15:43:33 +0000 (17:43 +0200)] 
ntp: include local error in hwclock samples

8 years agontp: remove unnecessary include
Miroslav Lichvar [Fri, 5 May 2017 11:39:12 +0000 (13:39 +0200)] 
ntp: remove unnecessary include

8 years agosys_linux: allow sysinfo in seccomp filter
Miroslav Lichvar [Wed, 19 Apr 2017 12:38:51 +0000 (14:38 +0200)] 
sys_linux: allow sysinfo in seccomp filter

It may be used by glob() in latest glibc.

8 years agosys_linux: don't drop PHC samples with zero delay
Miroslav Lichvar [Wed, 19 Apr 2017 10:20:14 +0000 (12:20 +0200)] 
sys_linux: don't drop PHC samples with zero delay

When processing data from the PTP_SYS_OFFSET ioctl, the sample is
dropped when an interval between two consecutive readings of the system
clock is negative or zero, assuming the clock has been stepped between
the two readings.

With a real PHC the interval is normally expected to be at least a
microsecond, but with a virtual PHC and a low-resolution system clock
it's possible to get two readings with the same system time. Modify the
check to drop only samples with a negative delay.

8 years agoconfigure: check for clang
Miroslav Lichvar [Wed, 5 Apr 2017 11:10:40 +0000 (13:10 +0200)] 
configure: check for clang

Try clang as the C compiler before cc and use the same -W* CFLAGS as
with gcc.

8 years agoutil: indicate truncated Unix socket path in UTI_SockaddrToString()
Miroslav Lichvar [Wed, 5 Apr 2017 09:20:22 +0000 (11:20 +0200)] 
util: indicate truncated Unix socket path in UTI_SockaddrToString()

Specify the maximum length of the path in the snprintf() format to avoid
a new gcc warning (-Wformat-truncation). If the path doesn't fit in the
buffer, indicate with the '>' symbol that it was truncated. The function
is used only for debug messages.

8 years agomakefile: run tests in multiple iterations on check
Miroslav Lichvar [Fri, 31 Mar 2017 12:09:46 +0000 (14:09 +0200)] 
makefile: run tests in multiple iterations on check

Use the new options of the run script in the check target to make it
reliable for automatic testing without using a fixed random seed and add
a new quickcheck target for the original check using just one iteration.

8 years agotest: improve run script
Miroslav Lichvar [Fri, 31 Mar 2017 12:07:34 +0000 (14:07 +0200)] 
test: improve run script

Add options to allow running the tests in multiple iterations while
allowing a small number of failures per test. Some tests are expected to
fail occasionally as they are basically statistical tests. Improving
their reliability is possible, but it's always a compromise between
sensitivity, reliability, and execution time.

8 years agotest: make 118-maxdelay more reliable
Miroslav Lichvar [Fri, 31 Mar 2017 11:05:38 +0000 (13:05 +0200)] 
test: make 118-maxdelay more reliable

8 years agosys_linux: allow getpid in seccomp filter
Miroslav Lichvar [Mon, 13 Mar 2017 13:26:12 +0000 (14:26 +0100)] 
sys_linux: allow getpid in seccomp filter

It seems to be used by syslog() in latest glibc.

8 years agotest: fix DEBUG_LOG use in unit tests
Miroslav Lichvar [Mon, 13 Mar 2017 10:54:32 +0000 (11:54 +0100)] 
test: fix DEBUG_LOG use in unit tests

This was missing in commit f282856c72b7e8904e70527210915e12e6ed7227.

8 years agosourcestats: reorder arguments to DEBUG_LOG in SST_IsGoodSample
Chris Perl [Fri, 10 Mar 2017 13:45:41 +0000 (08:45 -0500)] 
sourcestats: reorder arguments to DEBUG_LOG in SST_IsGoodSample

The delay_increase and allowed_increase variables are backwards with
respect to the ordering of the words in the message.

8 years agotest: make 117-fallbackdrift more reliable
Miroslav Lichvar [Fri, 10 Mar 2017 15:49:57 +0000 (16:49 +0100)] 
test: make 117-fallbackdrift more reliable

8 years agosys: add null driver
Miroslav Lichvar [Thu, 9 Mar 2017 17:16:56 +0000 (18:16 +0100)] 
sys: add null driver

Add a new clock driver that doesn't actually try to adjust the clock.
It allows chronyd to run without the capability to adjust/set the system
clock, e.g. in some containers. It can be enabled by the -x option.

8 years agolocal: improve log message for failed clock step
Miroslav Lichvar [Thu, 9 Mar 2017 15:09:36 +0000 (16:09 +0100)] 
local: improve log message for failed clock step

8 years agomain: dump history by default
Miroslav Lichvar [Wed, 8 Mar 2017 09:45:20 +0000 (10:45 +0100)] 
main: dump history by default

Always write the measurement history on exit when the dump directory is
specified and silently ignore the dumponexit directive. There doesn't
seem to be a good use case for dumpdir and -r without dumponexit as the
history would be invalidated by adjustments of the clock that happened
between the dump command and chronyd exit.

8 years agomain: rewrite some error messages
Miroslav Lichvar [Wed, 8 Mar 2017 09:14:35 +0000 (10:14 +0100)] 
main: rewrite some error messages

8 years agologging: remove facility parameter
Miroslav Lichvar [Tue, 7 Mar 2017 16:30:09 +0000 (17:30 +0100)] 
logging: remove facility parameter

It was never used for anything and messages in debug output already
include filenames, which can be easily grepped if there is a need
to see log messages only from a particular file.

8 years agoprivops: separate res_init() call
Miroslav Lichvar [Tue, 7 Mar 2017 15:43:33 +0000 (16:43 +0100)] 
privops: separate res_init() call

Move the res_init() call from do_name_to_ipaddress() into a separate
privops operation. Use it in ntp_sources and avoid unnecessary
res_init() calls in the main thread.

8 years agodoc: update NEWS 3.1
Miroslav Lichvar [Tue, 31 Jan 2017 09:05:45 +0000 (10:05 +0100)] 
doc: update NEWS

8 years agomakefile: fix distclean target to not print errors
Miroslav Lichvar [Tue, 31 Jan 2017 10:20:08 +0000 (11:20 +0100)] 
makefile: fix distclean target to not print errors

8 years agoexamples: improve configuration examples
Miroslav Lichvar [Mon, 30 Jan 2017 17:33:19 +0000 (18:33 +0100)] 
examples: improve configuration examples

8 years agoexamples: improve systemd unit files
Miroslav Lichvar [Mon, 30 Jan 2017 14:07:48 +0000 (15:07 +0100)] 
examples: improve systemd unit files

Add the PrivateTmp, ProtectHome, and ProtectSystem directives to better
secure the system from chronyd. It's taken from the Debian chrony
package.

8 years agotest: add keys unit test
Miroslav Lichvar [Mon, 30 Jan 2017 13:44:57 +0000 (14:44 +0100)] 
test: add keys unit test

8 years agodoc: document rekey in chronyc man page
Miroslav Lichvar [Mon, 30 Jan 2017 11:34:43 +0000 (12:34 +0100)] 
doc: document rekey in chronyc man page

For some reason this useful command was never documented.

8 years agoclient: add rekey to help text
Miroslav Lichvar [Mon, 30 Jan 2017 11:14:03 +0000 (12:14 +0100)] 
client: add rekey to help text

8 years agoutil: fix more coverity warnings
Miroslav Lichvar [Mon, 30 Jan 2017 09:55:40 +0000 (10:55 +0100)] 
util: fix more coverity warnings

Coverity doesn't seem to like the new field in the IPAddr struct (used
as explicit padding of the structure) to be left uninitialized, even
though it's never used for anything and is cleared by memset() in
UTI_IPHostToNetwork() before leaving the process.

8 years agoconf: add rawmeasurements log option
Miroslav Lichvar [Mon, 30 Jan 2017 08:22:51 +0000 (09:22 +0100)] 
conf: add rawmeasurements log option

While the measurements log can be useful for debugging problems in NTP
configuration (e.g. authentication failures with symmetric keys), it
seems most users are interested only in valid measurements (e.g. for
producing graphs) and don't expect/handle entries where some of the RFC
5905 tests 1-7 failed. Modify the measurements log option to log only
valid measurements, and for debugging purposes add a new rawmeasurements
option.

8 years agotest: update 110-chronyc
Miroslav Lichvar [Fri, 27 Jan 2017 10:54:12 +0000 (11:54 +0100)] 
test: update 110-chronyc

8 years agodoc: improve FAQ
Miroslav Lichvar [Fri, 27 Jan 2017 10:45:50 +0000 (11:45 +0100)] 
doc: improve FAQ

8 years agoclient: print tracking delay/dispersion in nanosecond resolution
Miroslav Lichvar [Fri, 27 Jan 2017 09:51:39 +0000 (10:51 +0100)] 
client: print tracking delay/dispersion in nanosecond resolution