]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
8 years agotest: extend 105-ntpauth
Miroslav Lichvar [Fri, 2 Dec 2016 07:53:49 +0000 (08:53 +0100)] 
test: extend 105-ntpauth

8 years agontp: truncate MACs in NTPv4 packets
Miroslav Lichvar [Tue, 29 Nov 2016 11:59:57 +0000 (12:59 +0100)] 
ntp: truncate MACs in NTPv4 packets

When sending an NTPv4 packet, truncate long MAC to 192 bits to follow
RFC 7822.

8 years agontp: accept NTPv4 packets with truncated MACs
Miroslav Lichvar [Tue, 29 Nov 2016 11:52:20 +0000 (12:52 +0100)] 
ntp: accept NTPv4 packets with truncated MACs

In order to allow deterministic parsing of NTPv4 extension fields, the
MAC must not be longer than 192 bits (RFC 7822). One way to get around
this limitation when using symmetric keys which produce longer MACs is
to truncate them to 192 bits (32-bit key ID and 160-bit hash).

Modify the code to accept NTPv4 packets with MACs truncated to 192
bits, but still allow long MACs in NTPv4 packets to not break
compatibility with older chrony clients.

8 years agokeys: add support for checking truncated MACs
Miroslav Lichvar [Tue, 29 Nov 2016 10:32:39 +0000 (11:32 +0100)] 
keys: add support for checking truncated MACs

8 years agoutil: move authentication and password decoding functions to keys
Miroslav Lichvar [Tue, 29 Nov 2016 10:04:17 +0000 (11:04 +0100)] 
util: move authentication and password decoding functions to keys

This doesn't need to be included in chronyc.

8 years agodoc: update FAQ
Miroslav Lichvar [Mon, 28 Nov 2016 15:42:31 +0000 (16:42 +0100)] 
doc: update FAQ

8 years agodoc: update man pages
Miroslav Lichvar [Mon, 28 Nov 2016 15:02:51 +0000 (16:02 +0100)] 
doc: update man pages

8 years agodoc: update README
Miroslav Lichvar [Mon, 28 Nov 2016 10:42:43 +0000 (11:42 +0100)] 
doc: update README

8 years agontp: fix length modifier of refid in measurements log
Miroslav Lichvar [Mon, 28 Nov 2016 09:43:27 +0000 (10:43 +0100)] 
ntp: fix length modifier of refid in measurements log

8 years agoclient: zero pad reference ID
Miroslav Lichvar [Mon, 28 Nov 2016 09:43:12 +0000 (10:43 +0100)] 
client: zero pad reference ID

8 years agoclient: add ntpdata command
Miroslav Lichvar [Fri, 25 Nov 2016 15:28:09 +0000 (16:28 +0100)] 
client: add ntpdata command

8 years agocmdmon: add ntpdata command
Miroslav Lichvar [Fri, 25 Nov 2016 14:02:35 +0000 (15:02 +0100)] 
cmdmon: add ntpdata command

8 years agoclient: fix format specifiers in sourcestats report
Miroslav Lichvar [Fri, 25 Nov 2016 09:16:28 +0000 (10:16 +0100)] 
client: fix format specifiers in sourcestats report

8 years agoclient: add new format specifiers to print_report()
Miroslav Lichvar [Fri, 25 Nov 2016 09:15:58 +0000 (10:15 +0100)] 
client: add new format specifiers to print_report()

8 years agoclient: print reference ID in hexadecimal
Miroslav Lichvar [Fri, 25 Nov 2016 08:57:14 +0000 (09:57 +0100)] 
client: print reference ID in hexadecimal

This is an incompatible change in the output of the tracking command,
which may break some scripts, but it's necessary to avoid confusion with
IPv4 addresses when synchronised to an IPv6 server or reference clock.

8 years agosources: give access to sourcestats instance
Miroslav Lichvar [Fri, 25 Nov 2016 13:22:36 +0000 (14:22 +0100)] 
sources: give access to sourcestats instance

Give access to the sourcestats instance and remove all functions that
just translated to SST calls.

8 years agontp: add new debug message
Miroslav Lichvar [Fri, 25 Nov 2016 08:21:44 +0000 (09:21 +0100)] 
ntp: add new debug message

8 years agontp: fix logging of RX timestamp source in interleaved mode
Miroslav Lichvar [Thu, 24 Nov 2016 15:27:47 +0000 (16:27 +0100)] 
ntp: fix logging of RX timestamp source in interleaved mode

8 years agontp: don't send presend packets in burst mode
Miroslav Lichvar [Thu, 24 Nov 2016 09:09:50 +0000 (10:09 +0100)] 
ntp: don't send presend packets in burst mode

8 years agontp: allow presend of zero
Miroslav Lichvar [Wed, 23 Nov 2016 15:48:27 +0000 (16:48 +0100)] 
ntp: allow presend of zero

Don't use zero as a special value for disabled and change the default
presend to a value larger than any valid poll.

8 years agontp: send two presend packets in interleaved mode
Miroslav Lichvar [Wed, 23 Nov 2016 15:34:53 +0000 (16:34 +0100)] 
ntp: send two presend packets in interleaved mode

In a burst of three requests (two presend + one normal) the server can
detect the client is using the interleaved mode and save the transmit
timestamp of the second response for the third response. This shortens
the interval in which the server has to keep the state.

8 years agontp: shorten presend delay to 2 seconds
Miroslav Lichvar [Wed, 23 Nov 2016 14:55:37 +0000 (15:55 +0100)] 
ntp: shorten presend delay to 2 seconds

8 years agontp: process presend responses
Miroslav Lichvar [Wed, 23 Nov 2016 14:43:07 +0000 (15:43 +0100)] 
ntp: process presend responses

Rework the code to make a real request for presend and process the
response, but don't accumulate the sample. This allows presend to work
in the interleaved client mode.

8 years agoreference: randomize reference time
Miroslav Lichvar [Wed, 23 Nov 2016 13:03:12 +0000 (14:03 +0100)] 
reference: randomize reference time

In unauthenticated interleaved symmetric NTP mode we should be now
careful with the reference timestamp as it may be useful with the peer
delay for estimating the local receive timestamp and increasing the
chance of spoofing a valid response from the peer.

When updating the reference time, add a random error of up to one second
to make it less sensitive when disclosed to NTP and cmdmon clients.

8 years agontp: don't reset polling interval when switching to/from online
Miroslav Lichvar [Wed, 23 Nov 2016 11:45:11 +0000 (12:45 +0100)] 
ntp: don't reset polling interval when switching to/from online

This allows chronyd to ramp up the polling interval even when the source
is frequently switched between the online and offline modes.

8 years agontp: fix calculation of PHC sample time
Miroslav Lichvar [Wed, 23 Nov 2016 09:06:06 +0000 (10:06 +0100)] 
ntp: fix calculation of PHC sample time

8 years agosys_linux: allow ioctls used with HW timestamping in seccomp filter
Miroslav Lichvar [Wed, 23 Nov 2016 07:57:32 +0000 (08:57 +0100)] 
sys_linux: allow ioctls used with HW timestamping in seccomp filter

8 years agontp: transpose HW RX timestamps
Miroslav Lichvar [Mon, 21 Nov 2016 15:23:57 +0000 (16:23 +0100)] 
ntp: transpose HW RX timestamps

We need to transpose HW RX timestamps as HW timestamps are normally
preamble timestamps and RX timestamps in NTP are supposed to be trailer
timestamps. Without raw sockets we don't know the length of the packet
at layer 2, so we make an assumption that UDP data start at the same
position as in the last transmitted packet which had a HW TX timestamp.

8 years agoMerge branch '2.4-stable' into HEAD
Miroslav Lichvar [Tue, 22 Nov 2016 15:06:05 +0000 (16:06 +0100)] 
Merge branch '2.4-stable' into HEAD

8 years agorefclock: don't compare sample time with samples from previous poll
Miroslav Lichvar [Mon, 21 Nov 2016 10:20:57 +0000 (11:20 +0100)] 
refclock: don't compare sample time with samples from previous poll

This is an improvement of commit 8f85291d23560508e03938bfa894294f73ad2d9e.

8 years agodoc: update NEWS 2.4-stable 2.4.1
Miroslav Lichvar [Mon, 21 Nov 2016 10:58:26 +0000 (11:58 +0100)] 
doc: update NEWS

8 years agosources: add new status for sources that overlap trusted sources
Miroslav Lichvar [Fri, 11 Nov 2016 13:04:12 +0000 (14:04 +0100)] 
sources: add new status for sources that overlap trusted sources

Sources that overlap trusted sources should be displayed in the chronyc
sources report with the '-' symbol and they shouldn't trigger a
replacement.

8 years agorefclock: don't compare sample time with samples from previous poll
Miroslav Lichvar [Mon, 21 Nov 2016 10:20:57 +0000 (11:20 +0100)] 
refclock: don't compare sample time with samples from previous poll

This is an improvement of commit 0a848e2528aaef0b3347de0b49ce50da8dc1c9a4.

8 years agorefclock: fix check for old samples
Miroslav Lichvar [Fri, 7 Oct 2016 08:59:45 +0000 (10:59 +0200)] 
refclock: fix check for old samples

The fix in commit 0a848e2528aaef0b3347de0b49ce50da8dc1c9a4 was
incorrect.

8 years agorefclock: require new samples to have newer timestamp
Miroslav Lichvar [Thu, 6 Oct 2016 13:21:43 +0000 (15:21 +0200)] 
refclock: require new samples to have newer timestamp

If all or most SHM/SOCK samples collected in a polling interval had the
same local timestamp, the dispersion could end up as nan, which could
trigger an assert failure later in the code.

Before accumulating a refclock sample, check if the timestamp is newer
than the previous one.

8 years agotest: add smooth unit test
Miroslav Lichvar [Mon, 12 Sep 2016 10:55:57 +0000 (12:55 +0200)] 
test: add smooth unit test

8 years agosmooth: fix selection of 1st stage direction
Miroslav Lichvar [Mon, 12 Sep 2016 10:23:09 +0000 (12:23 +0200)] 
smooth: fix selection of 1st stage direction

When the smoothing process is updated with extremely small (e.g.
sub-nanosecond) values, both directions may give a negative length of
the 1st or 3rd stage due to numerical errors and the selection will fail
an in assertion. Rework the code to select the direction which gives a
smaller error.

8 years agoclient: flush stdout after printing prompt
Miroslav Lichvar [Tue, 6 Sep 2016 13:47:40 +0000 (15:47 +0200)] 
client: flush stdout after printing prompt

Apparently fgets() doesn't flush stdout in some libc implementations.

8 years agoclient: fix printing of negative poll in sources report again
Miroslav Lichvar [Tue, 6 Sep 2016 13:42:00 +0000 (15:42 +0200)] 
client: fix printing of negative poll in sources report again

This was broken in commit 3f51805e6214cad5cb9a863491316937541601ec.

8 years agontp: fix processing of kernel timestamps on non-Linux systems
Miroslav Lichvar [Mon, 22 Aug 2016 11:14:45 +0000 (13:14 +0200)] 
ntp: fix processing of kernel timestamps on non-Linux systems

When the SO_TIMESTAMP socket option was enabled, the expected type of
control messages containing timestamps was SO_TIMESTAMP instead of
SCM_TIMESTAMP. This worked on Linux, where the two values are equal, but
not on the other supported systems. The timestamps were ignored and this
probably worsened the accuracy and stability of the synchronisation.

8 years agoconf: fix parsing of refclock directive
Miroslav Lichvar [Mon, 27 Jun 2016 12:38:51 +0000 (14:38 +0200)] 
conf: fix parsing of refclock directive

Don't accept refclock directive which has as the last argument an option
that requires a value.

8 years agontp: add debug message for truncated control messages
Miroslav Lichvar [Tue, 15 Nov 2016 11:13:49 +0000 (12:13 +0100)] 
ntp: add debug message for truncated control messages

8 years agontp: ignore truncated messages
Miroslav Lichvar [Tue, 15 Nov 2016 11:10:50 +0000 (12:10 +0100)] 
ntp: ignore truncated messages

Don't waste time with processing messages that don't fit in the receive
buffer as they most likely wouldn't pass the format check due to an
invalid length of an extension field.

8 years agohwclock: fix order of samples
Miroslav Lichvar [Tue, 15 Nov 2016 10:26:18 +0000 (11:26 +0100)] 
hwclock: fix order of samples

In order to trim oldest samples in the regression function, they need to
be sorted in the data arrays from the oldest to newest.

8 years agontp: detect unexpected TX updates of unknown sources
Miroslav Lichvar [Mon, 14 Nov 2016 11:18:56 +0000 (12:18 +0100)] 
ntp: detect unexpected TX updates of unknown sources

8 years agontp: improve replay protection in symmetric mode
Miroslav Lichvar [Mon, 14 Nov 2016 08:27:07 +0000 (09:27 +0100)] 
ntp: improve replay protection in symmetric mode

Always allow update from the first valid response, even if its transmit
timestamp is not newer than the currently saved timestamp. This shoud
provide a temporary protection in the case where the attacker does have
an authenticated packet from future, but the peers are using the same
polling interval and the protocol is already synchronised. This could be
also useful in the case where the attacker cannot observe the traffic
and authentication is disabled.

8 years agosched: add more random bits to timeout scheduling
Miroslav Lichvar [Mon, 14 Nov 2016 07:43:54 +0000 (08:43 +0100)] 
sched: add more random bits to timeout scheduling

Extend the random value which is included in the calculation of the
delay from 16 to 32 bits. This makes scheduling of NTP transmissions
random to one microsecond for polling intervals up to 17.

8 years agoclient: randomize sequence number in requests
Miroslav Lichvar [Fri, 11 Nov 2016 16:20:38 +0000 (17:20 +0100)] 
client: randomize sequence number in requests

Don't rely on random source port of a connected socket alone as a
protection against spoofed packets in chronyc. Generate a fully random
32-bit sequence number for each request and modify the code to not send
a new request until the timeout expires or a valid response is received.
For a monitoring protocol this should be more than good enough.

8 years agoclient: fix attempt number in requests to be in network order
Miroslav Lichvar [Fri, 11 Nov 2016 15:53:51 +0000 (16:53 +0100)] 
client: fix attempt number in requests to be in network order

8 years agoreport: remove unused definition
Miroslav Lichvar [Fri, 11 Nov 2016 13:17:02 +0000 (14:17 +0100)] 
report: remove unused definition

8 years agosources: add new status for sources that overlap trusted sources
Miroslav Lichvar [Fri, 11 Nov 2016 13:04:12 +0000 (14:04 +0100)] 
sources: add new status for sources that overlap trusted sources

Sources that overlap trusted sources should be displayed in the chronyc
sources report with the '-' symbol and they shouldn't trigger a
replacement.

8 years agosources: don't log warning when opening dump file fails
Miroslav Lichvar [Fri, 11 Nov 2016 12:32:54 +0000 (13:32 +0100)] 
sources: don't log warning when opening dump file fails

Instead of complaining when the file doesn't exist, which is common when
using pool servers, log an informational message when the file is
loaded.

8 years agoconf: create socket directory before logdir and dumpdir
Miroslav Lichvar [Fri, 11 Nov 2016 12:07:28 +0000 (13:07 +0100)] 
conf: create socket directory before logdir and dumpdir

This allows sharing of the same directory for sockets, logs and dumps as
the socket directory needs to be created first (with mode 0770) in order
to pass the check of the permissions.

8 years agontp: print offset and delay in debug messages in nanosecond resolution
Miroslav Lichvar [Wed, 9 Nov 2016 16:33:03 +0000 (17:33 +0100)] 
ntp: print offset and delay in debug messages in nanosecond resolution

8 years agontp: fix remote poll in measurements log
Miroslav Lichvar [Wed, 9 Nov 2016 16:31:55 +0000 (17:31 +0100)] 
ntp: fix remote poll in measurements log

Write the poll value from the received packet instead of the saved
value, which doesn't have to be always updated.

8 years agontp: add new fields to measurements log
Miroslav Lichvar [Wed, 9 Nov 2016 16:31:34 +0000 (17:31 +0100)] 
ntp: add new fields to measurements log

Include reference ID, NTP mode and source of the local transmit and
receive timestamp in the measurements log.

8 years agontp: add partial protection against replay attacks on symmetric mode
Miroslav Lichvar [Tue, 8 Nov 2016 14:53:40 +0000 (15:53 +0100)] 
ntp: add partial protection against replay attacks on symmetric mode

A recently published paper [1] (section VIII) describes a DoS attack
on symmetric associations authenticated with a symmetric key where the
attacker can only observe and replay packets. Although the attacker
cannot prevent packets from reaching the other peer (not even by
flooding the network for example), s/he has the same power as a MitM
attacker.

As the authors explain, this is a fundamental flaw of the protocol,
which cannot be fixed in the general case. However, we can at least try
to protect associations in a case where the peers use the same polling
interval (i.e. for each request is expected one response) and all peers
that share the symmetric key never start with clocks in future or very
distant past (i.e. the attacker does not have any packets from future
that could be replayed).

Require that updates of the NTP state between requests have increasing
transmit timestamp and when a packet that passed all NTP tests to be
considered a valid response was received, don't allow any more updates
of the state from packets that don't pass the tests. This should ensure
the last update of the state is from the first time the last real
response was received and still allow the protocol to recover in case
one of the peers steps its clock back or the attacker does have a packet
from future and the attack stops.

[1] Aanchal Malhotra, Matthew Van Gundy, Mayank Varia, Haydn Kennedy,
    Jonathan Gardner, and Sharon Goldberg. The Security of NTP's
    Datagram Protocol. https://eprint.iacr.org/2016/1006

8 years agontp: disable presend in symmetric and interleaved modes
Miroslav Lichvar [Thu, 3 Nov 2016 07:06:26 +0000 (08:06 +0100)] 
ntp: disable presend in symmetric and interleaved modes

The presend packet can't be used in symmetric and interleaved modes as
it breaks the protocol with unexpected packets.

8 years agotest: add util unit test
Miroslav Lichvar [Mon, 24 Oct 2016 15:10:28 +0000 (17:10 +0200)] 
test: add util unit test

8 years agoutil: add functions for zeroing and comparing NTP timestamps
Miroslav Lichvar [Mon, 24 Oct 2016 14:46:29 +0000 (16:46 +0200)] 
util: add functions for zeroing and comparing NTP timestamps

8 years agontp: fix poll value in broadcast mode packets
Miroslav Lichvar [Mon, 24 Oct 2016 12:54:58 +0000 (14:54 +0200)] 
ntp: fix poll value in broadcast mode packets

Set poll in broadcast mode packets to the rounded log2 value of the
actual interval instead of a hardcoded value.

8 years agodoc: update chrony.conf man page for recent changes
Miroslav Lichvar [Mon, 24 Oct 2016 12:34:50 +0000 (14:34 +0200)] 
doc: update chrony.conf man page for recent changes

8 years agontp: add support for HW timestamping on Linux
Miroslav Lichvar [Mon, 24 Oct 2016 10:44:59 +0000 (12:44 +0200)] 
ntp: add support for HW timestamping on Linux

Add a new directive to specify interfaces which should be used for HW
timestamping. Extend the Linux ntp_io initialization to enable HW
timestamping, configure the RX filter using the SIOCSHWTSTAMP ioctl,
open their PHC devices, and track them as hwclock instances. When
messages with HW timestamps are received, use the PTP_SYS_OFFSET ioctl
to make PHC samples for hwclock.

8 years agontp: read interface index from control messages
Miroslav Lichvar [Mon, 24 Oct 2016 10:35:01 +0000 (12:35 +0200)] 
ntp: read interface index from control messages

8 years agotest: add 122-xleave
Miroslav Lichvar [Thu, 27 Oct 2016 08:57:29 +0000 (10:57 +0200)] 
test: add 122-xleave

8 years agotest: add hwclock unit test
Miroslav Lichvar [Fri, 21 Oct 2016 14:51:06 +0000 (16:51 +0200)] 
test: add hwclock unit test

8 years agohwclock: add support for tracking hardware clocks
Miroslav Lichvar [Wed, 19 Oct 2016 14:57:32 +0000 (16:57 +0200)] 
hwclock: add support for tracking hardware clocks

Add a general support for tracking independent hardware clocks like PTP
hardware clocks (PHC) or real-time clocks (RTC).

8 years agoclientlog: move status check to get_record()
Miroslav Lichvar [Wed, 12 Oct 2016 08:02:18 +0000 (10:02 +0200)] 
clientlog: move status check to get_record()

8 years agontp: add support for interleaved client/server mode
Miroslav Lichvar [Tue, 11 Oct 2016 15:15:56 +0000 (17:15 +0200)] 
ntp: add support for interleaved client/server mode

Adapt the interleaved symmetric mode for client/server associations.
On server, save the state needed for detection and responding in the
interleaved mode in the client log. On client, enable the interleaved
mode when the server is specified with the xleave option. Always accept
responses in basic mode to allow synchronization with servers that
don't support the interleaved mode, have too many clients, or have
multiple clients behing the same IP address. This is also necessary to
prevent DoS attacks on the client by overwriting or flushing the server
state. Protect the client's state variables against replay attacks as
the timestamps are now needed when processing the subsequent packet.

8 years agontp: check also NTP receive timestamp when updating TX timestamp
Miroslav Lichvar [Tue, 11 Oct 2016 15:06:58 +0000 (17:06 +0200)] 
ntp: check also NTP receive timestamp when updating TX timestamp

8 years agontp: add support for interleaved symmetric mode
Miroslav Lichvar [Mon, 10 Oct 2016 10:15:34 +0000 (12:15 +0200)] 
ntp: add support for interleaved symmetric mode

Add xleave option to the peer directive to enable an interleaved mode
compatible with ntpd. This allows peers to exchange transmit timestamps
captured after the actual transmission and significantly improve
the accuracy of the measurements.

8 years agontp: add support for software timestamping on Linux
Miroslav Lichvar [Fri, 7 Oct 2016 15:03:09 +0000 (17:03 +0200)] 
ntp: add support for software timestamping on Linux

Enable SCM_TIMESTAMPING control messages and the socket's error queue in
order to receive our transmitted packets with a more accurate transmit
timestamp. Add a new file for Linux-specific NTP I/O and implement
processing of these messages there.

8 years agontp: save source of local timestamps
Miroslav Lichvar [Fri, 7 Oct 2016 13:40:49 +0000 (15:40 +0200)] 
ntp: save source of local timestamps

Introduce a new structure for local timestamps that will hold the
timestamp with its estimated error and also its source (daemon, kernel
or HW). While at it, reorder parameters of the functions that accept the
timestamps.

8 years agontp: add support for processing of transmitted packets
Miroslav Lichvar [Fri, 7 Oct 2016 12:08:07 +0000 (14:08 +0200)] 
ntp: add support for processing of transmitted packets

Add new functions for processing of packets after they are actually
sent by the kernel or HW in order to get a more accurate transmit
timestamp. Rename old functions for processing of received packets and
their parameters to make the naming more consistent.

8 years agosys_linux: add function for checking kernel version
Miroslav Lichvar [Wed, 26 Oct 2016 08:24:49 +0000 (10:24 +0200)] 
sys_linux: add function for checking kernel version

8 years agorefclock: fix check for old samples
Miroslav Lichvar [Fri, 7 Oct 2016 08:59:45 +0000 (10:59 +0200)] 
refclock: fix check for old samples

The fix in commit 8f85291d23560508e03938bfa894294f73ad2d9e was
incorrect.

8 years agorefclock: require new samples to have newer timestamp
Miroslav Lichvar [Thu, 6 Oct 2016 13:21:43 +0000 (15:21 +0200)] 
refclock: require new samples to have newer timestamp

If all or most SHM/SOCK samples collected in a polling interval had the
same local timestamp, the dispersion could end up as nan, which could
trigger an assert failure later in the code.

Before accumulating a refclock sample, check if the timestamp is newer
than the previous one.

8 years agontp: inline send_packet()
Miroslav Lichvar [Mon, 26 Sep 2016 10:28:31 +0000 (12:28 +0200)] 
ntp: inline send_packet()

Also, reuse existing function for checking server sockets.

8 years agontp: use ipi_addr from struct in_pktinfo as local address
Miroslav Lichvar [Mon, 26 Sep 2016 10:24:49 +0000 (12:24 +0200)] 
ntp: use ipi_addr from struct in_pktinfo as local address

Use the ipi_addr field instead of ipi_spec_dst as the local address
after recvmsg() to be consistent with the processing of struct
in6_pktinfo. This may make a difference for messages from the error
queue.

8 years agontp: check for missing source address after recvmsg()
Miroslav Lichvar [Mon, 26 Sep 2016 10:21:07 +0000 (12:21 +0200)] 
ntp: check for missing source address after recvmsg()

8 years agontp: fix updating of transmit delay in symmetric mode
Miroslav Lichvar [Mon, 26 Sep 2016 10:18:17 +0000 (12:18 +0200)] 
ntp: fix updating of transmit delay in symmetric mode

This was broken in commit cea21adbbbaf38271e33cd8b412c55ee541c0c37.

8 years agosched: add support for handling exceptions on descriptors
Miroslav Lichvar [Mon, 26 Sep 2016 10:16:42 +0000 (12:16 +0200)] 
sched: add support for handling exceptions on descriptors

8 years agosys_linux: allow getdents in seccomp filter
Miroslav Lichvar [Wed, 21 Sep 2016 08:35:57 +0000 (10:35 +0200)] 
sys_linux: allow getdents in seccomp filter

This is needed for glob(), which is used with the include and dumpdir
directives.

8 years agorefclock: use UTI_TimespecToString() in debug message
Miroslav Lichvar [Fri, 16 Sep 2016 08:13:08 +0000 (10:13 +0200)] 
refclock: use UTI_TimespecToString() in debug message

8 years agoutil: add UTI_IsZeroTimespec()
Miroslav Lichvar [Fri, 16 Sep 2016 08:01:37 +0000 (10:01 +0200)] 
util: add UTI_IsZeroTimespec()

8 years agotest: add smooth unit test
Miroslav Lichvar [Mon, 12 Sep 2016 10:55:57 +0000 (12:55 +0200)] 
test: add smooth unit test

8 years agosmooth: fix selection of 1st stage direction
Miroslav Lichvar [Mon, 12 Sep 2016 10:23:09 +0000 (12:23 +0200)] 
smooth: fix selection of 1st stage direction

When the smoothing process is updated with extremely small (e.g.
sub-nanosecond) values, both directions may give a negative length of
the 1st or 3rd stage due to numerical errors and the selection will fail
an in assertion. Rework the code to select the direction which gives a
smaller error.

8 years agosched: initialize sub-second part of saved_tv in SCH_MainLoop()
Miroslav Lichvar [Wed, 7 Sep 2016 09:49:36 +0000 (11:49 +0200)] 
sched: initialize sub-second part of saved_tv in SCH_MainLoop()

This is needed since commit d0dfa1de9e85510a584cdec5faae96c66d6847c9 to
avoid valgrind errors.

8 years agouse correct facility in LOG messages
Miroslav Lichvar [Wed, 7 Sep 2016 08:37:26 +0000 (10:37 +0200)] 
use correct facility in LOG messages

8 years agosources: remove dump files on start
Miroslav Lichvar [Wed, 7 Sep 2016 08:26:42 +0000 (10:26 +0200)] 
sources: remove dump files on start

When chronyd is starting, after the point where dump files are loaded,
remove all files in the dump directory that match the naming scheme used
for dump files. This prevents loading stale dump files that were not
saved in the latest run of chronyd.

8 years agoconf: disable dumpdir and logdir by default
Miroslav Lichvar [Tue, 6 Sep 2016 15:23:39 +0000 (17:23 +0200)] 
conf: disable dumpdir and logdir by default

Use empty string instead of "." (which is normally the root directory)
as the default value of dumpdir and logdir to indicate they are not
specified. Print warnings in syslog when trying to log or dump
measurements without dumpdir or logdir.

8 years agoclient: flush stdout after printing prompt
Miroslav Lichvar [Tue, 6 Sep 2016 13:47:40 +0000 (15:47 +0200)] 
client: flush stdout after printing prompt

Apparently fgets() doesn't flush stdout in some libc implementations.

8 years agoclient: remove out of date comment
Miroslav Lichvar [Tue, 6 Sep 2016 13:46:49 +0000 (15:46 +0200)] 
client: remove out of date comment

8 years agoclient: fix printing of negative poll in sources report again
Miroslav Lichvar [Tue, 6 Sep 2016 13:42:00 +0000 (15:42 +0200)] 
client: fix printing of negative poll in sources report again

This was broken in commit 3f51805e6214cad5cb9a863491316937541601ec.

8 years agoclient: check address in waitsync command
Miroslav Lichvar [Tue, 6 Sep 2016 13:24:31 +0000 (15:24 +0200)] 
client: check address in waitsync command

8 years agoutil: convert invalid addresses as IPADDR_UNSPEC
Miroslav Lichvar [Tue, 6 Sep 2016 12:49:00 +0000 (14:49 +0200)] 
util: convert invalid addresses as IPADDR_UNSPEC

8 years agotest: add 011-asymjitter
Miroslav Lichvar [Wed, 24 Aug 2016 11:13:58 +0000 (13:13 +0200)] 
test: add 011-asymjitter

8 years agotest: add support for testing with asymmetric jitter
Miroslav Lichvar [Wed, 24 Aug 2016 11:13:20 +0000 (13:13 +0200)] 
test: add support for testing with asymmetric jitter

8 years agotest: extend 113-leapsecond
Miroslav Lichvar [Wed, 24 Aug 2016 08:40:21 +0000 (10:40 +0200)] 
test: extend 113-leapsecond

8 years agosources: include trust option in leap second voting
Miroslav Lichvar [Wed, 24 Aug 2016 08:21:39 +0000 (10:21 +0200)] 
sources: include trust option in leap second voting

When sources specified with the trust option pass the source selection,
ignore other sources in the vote of leap second status.