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

8 years agontp: check supported flags before enabling HW timestamping
Miroslav Lichvar [Fri, 27 Jan 2017 10:24:45 +0000 (11:24 +0100)] 
ntp: check supported flags before enabling HW timestamping

8 years agontp: log info message when HW timestamping is enabled
Miroslav Lichvar [Fri, 27 Jan 2017 09:36:37 +0000 (10:36 +0100)] 
ntp: log info message when HW timestamping is enabled

8 years agodoc: improve description of some server options
Miroslav Lichvar [Thu, 26 Jan 2017 11:32:28 +0000 (12:32 +0100)] 
doc: improve description of some server options

8 years agoreference: report zero root dispersion with local reference
Miroslav Lichvar [Thu, 26 Jan 2017 10:08:55 +0000 (11:08 +0100)] 
reference: report zero root dispersion with local reference

The server's precision is supposed to be included in client's
dispersion. Don't include it in the server's dispersion.

8 years agotest: fix memory leaks in unit tests
Miroslav Lichvar [Thu, 26 Jan 2017 09:37:25 +0000 (10:37 +0100)] 
test: fix memory leaks in unit tests

8 years agodoc: update NEWS 3.1-pre1
Miroslav Lichvar [Tue, 24 Jan 2017 14:03:24 +0000 (15:03 +0100)] 
doc: update NEWS

8 years agoupdate copyright years
Miroslav Lichvar [Tue, 24 Jan 2017 14:01:24 +0000 (15:01 +0100)] 
update copyright years

8 years agotest: extend 119-smoothtime
Miroslav Lichvar [Mon, 23 Jan 2017 11:12:36 +0000 (12:12 +0100)] 
test: extend 119-smoothtime

8 years agontp: fix time smoothing in interleaved mode
Miroslav Lichvar [Fri, 20 Jan 2017 12:17:45 +0000 (13:17 +0100)] 
ntp: fix time smoothing in interleaved mode

When the server's transmit timestamp was updated with a kernel/HW
timestamp, it didn't include the time smoothing offset. If the offset
was larger than one second, the update failed and clients using the
interleaved mode received less accurate timestamps. If the update
succeeded, the clients received timestamps that were not adjusted for
the time smoothing offset, which added an error of up to 0.5s/1s to
their measured offset/delay.

Fix the update to include the smoothing offset in the new timestamp.

8 years agontp: simplify UTI_Ntp64ToTimespec() callers
Miroslav Lichvar [Fri, 20 Jan 2017 11:05:02 +0000 (12:05 +0100)] 
ntp: simplify UTI_Ntp64ToTimespec() callers

Since UTI_Ntp64ToTimespec() was modified to handle zero timestamps, some
of its callers don't need to do that anymore.

8 years agontp: add interface index to NTP_Local_Address
Miroslav Lichvar [Fri, 20 Jan 2017 09:42:19 +0000 (10:42 +0100)] 
ntp: add interface index to NTP_Local_Address

This will allow us to get the interface index when sending responses to
clients.

8 years agorefclock_phc: add nocrossts option
Miroslav Lichvar [Thu, 19 Jan 2017 15:28:49 +0000 (16:28 +0100)] 
refclock_phc: add nocrossts option

8 years agoconf: add nocrossts option to hwtimestamp directive
Miroslav Lichvar [Thu, 19 Jan 2017 15:23:35 +0000 (16:23 +0100)] 
conf: add nocrossts option to hwtimestamp directive

This option disables the use of the PTP_SYS_OFFSET_PRECISE ioctl.

8 years agosys_linux: add support for PTP_SYS_OFFSET_PRECISE
Miroslav Lichvar [Thu, 19 Jan 2017 15:05:49 +0000 (16:05 +0100)] 
sys_linux: add support for PTP_SYS_OFFSET_PRECISE

This is for hardware that can precisely cross timestamp the PHC with the
system clock.

8 years agorefclock_phc: use sys_linux code for reading PHC
Miroslav Lichvar [Thu, 19 Jan 2017 14:54:01 +0000 (15:54 +0100)] 
refclock_phc: use sys_linux code for reading PHC

This drops support for non-ioctl reading of PHC.

8 years agontp: move PHC-specific code to sys_linux
Miroslav Lichvar [Thu, 19 Jan 2017 14:35:09 +0000 (15:35 +0100)] 
ntp: move PHC-specific code to sys_linux

This will allow sharing of the code with the PHC refclock driver.

8 years agoconf: add minpoll option to hwtimestamp directive
Miroslav Lichvar [Thu, 19 Jan 2017 11:59:06 +0000 (12:59 +0100)] 
conf: add minpoll option to hwtimestamp directive

8 years agohwclock: make minimum sampling separation configurable
Miroslav Lichvar [Thu, 19 Jan 2017 11:45:44 +0000 (12:45 +0100)] 
hwclock: make minimum sampling separation configurable

8 years agoconf: add precision option to hwtimestamp directive
Miroslav Lichvar [Thu, 19 Jan 2017 11:40:18 +0000 (12:40 +0100)] 
conf: add precision option to hwtimestamp directive

8 years agontp: include precision of PHC readings in their selection
Miroslav Lichvar [Thu, 19 Jan 2017 11:24:49 +0000 (12:24 +0100)] 
ntp: include precision of PHC readings in their selection

Include a fixed non-zero precision (100 nanosecond) in the selection of
PHC readings.

8 years agoconf: return hwtimestamp data in struct
Miroslav Lichvar [Thu, 19 Jan 2017 11:11:32 +0000 (12:11 +0100)] 
conf: return hwtimestamp data in struct

8 years agontp: include precision in maxdelay test
Miroslav Lichvar [Thu, 19 Jan 2017 10:31:26 +0000 (11:31 +0100)] 
ntp: include precision in maxdelay test

8 years agontp: adapt sampling separation for short polling intervals
Miroslav Lichvar [Thu, 19 Jan 2017 10:14:07 +0000 (11:14 +0100)] 
ntp: adapt sampling separation for short polling intervals

8 years agontp: allow sub-second polling intervals
Miroslav Lichvar [Thu, 19 Jan 2017 09:31:58 +0000 (10:31 +0100)] 
ntp: allow sub-second polling intervals

Change the minimum minpoll to -4, but keep the minimum maxpoll at 0 in
order to not make it too easy to flood distant servers.

8 years agontp: use current poll when backing off on KoD RATE
Miroslav Lichvar [Thu, 19 Jan 2017 09:17:08 +0000 (10:17 +0100)] 
ntp: use current poll when backing off on KoD RATE

8 years agontp: rename maxdelay constants
Miroslav Lichvar [Thu, 19 Jan 2017 09:10:23 +0000 (10:10 +0100)] 
ntp: rename maxdelay constants

8 years agontp: reset ntpdata report on address change
Miroslav Lichvar [Thu, 19 Jan 2017 09:03:32 +0000 (10:03 +0100)] 
ntp: reset ntpdata report on address change

8 years agoexamples: improve chronyd.service
Miroslav Lichvar [Thu, 19 Jan 2017 07:40:56 +0000 (08:40 +0100)] 
examples: improve chronyd.service

8 years agodoc: update README 3.0
Miroslav Lichvar [Thu, 12 Jan 2017 15:22:50 +0000 (16:22 +0100)] 
doc: update README

8 years agoupdate copyright years
Miroslav Lichvar [Thu, 12 Jan 2017 14:54:28 +0000 (15:54 +0100)] 
update copyright years

8 years agotest: add ntp_core unit test
Miroslav Lichvar [Tue, 10 Jan 2017 14:43:18 +0000 (15:43 +0100)] 
test: add ntp_core unit test

8 years agotest: make 119-smoothtime more reliable
Miroslav Lichvar [Thu, 12 Jan 2017 15:19:43 +0000 (16:19 +0100)] 
test: make 119-smoothtime more reliable

8 years agotest: extend util unit test
Miroslav Lichvar [Wed, 11 Jan 2017 14:29:23 +0000 (15:29 +0100)] 
test: extend util unit test

8 years agoutil: handle zero in conversion of NTP timestamps
Miroslav Lichvar [Tue, 10 Jan 2017 16:23:47 +0000 (17:23 +0100)] 
util: handle zero in conversion of NTP timestamps

Handle zero NTP timestamp in UTI_Ntp64ToTimespec() as a special value to
make it symmetric with UTI_TimespecToNtp64(). This is needed since
commit d75f6830f190037421a66754849571fd0b495e35, in which a timestamp is
converted back and forth without checking for zero.

It also makes zero NTP timestamps more apparent in debug output.

8 years agortc: check for backward RTC steps
Miroslav Lichvar [Thu, 12 Jan 2017 12:43:41 +0000 (13:43 +0100)] 
rtc: check for backward RTC steps

When accumulating a new sample, check if the new RTC time is newer the
last sample time. If it is not, discard all previous samples, assuming
something has stepped the RTC, or it's a broken RTC/driver.

8 years agosourcestats: align sample time used for source report
Miroslav Lichvar [Thu, 12 Jan 2017 11:21:50 +0000 (12:21 +0100)] 
sourcestats: align sample time used for source report

This reduces leak of sample times (and receive timestamps which are
related to sample times), which could be useful in off-path attacks on
unauthenticated symmetric interleaved mode.

8 years agolocal: add assertion for precision
Miroslav Lichvar [Tue, 10 Jan 2017 10:39:05 +0000 (11:39 +0100)] 
local: add assertion for precision

8 years agontp: don't send packets with RX equal to TX
Miroslav Lichvar [Tue, 10 Jan 2017 10:30:52 +0000 (11:30 +0100)] 
ntp: don't send packets with RX equal to TX

Before sending an NTP packet, check whether the TX timestamp is not
equal to the RX timestamp. If it is, generate a new TX timestamp and try
again. This is extremely unlikely to happen in normal operation, but it
is needed for reliable detection of the interleaved mode.

8 years agontp: limit maxdelay parameters
Miroslav Lichvar [Tue, 10 Jan 2017 09:58:44 +0000 (10:58 +0100)] 
ntp: limit maxdelay parameters

8 years agofix some coverity warnings
Miroslav Lichvar [Mon, 9 Jan 2017 12:43:26 +0000 (13:43 +0100)] 
fix some coverity warnings

8 years agodoc: update NEWS 3.0-pre3
Miroslav Lichvar [Fri, 6 Jan 2017 10:52:20 +0000 (11:52 +0100)] 
doc: update NEWS