]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
5 years agosocket: change SCK_Send() declaration to const buffer
Miroslav Lichvar [Tue, 19 Nov 2019 09:42:23 +0000 (10:42 +0100)] 
socket: change SCK_Send() declaration to const buffer

5 years agosocket: add support for opening socket pairs
Miroslav Lichvar [Mon, 18 Nov 2019 17:08:47 +0000 (18:08 +0100)] 
socket: add support for opening socket pairs

5 years agosocket: add support for blocking sockets
Miroslav Lichvar [Mon, 18 Nov 2019 17:07:16 +0000 (18:07 +0100)] 
socket: add support for blocking sockets

Add a flag to open a blocking socket. The default stays non-blocking.

5 years agosocket: remove unnecessary MSG_DONTWAIT flag
Miroslav Lichvar [Mon, 18 Nov 2019 17:05:17 +0000 (18:05 +0100)] 
socket: remove unnecessary MSG_DONTWAIT flag

This is not needed since sockets are non-blocking by default.

5 years agosocket: add support for sending and receiving descriptors
Miroslav Lichvar [Mon, 18 Nov 2019 17:04:43 +0000 (18:04 +0100)] 
socket: add support for sending and receiving descriptors

Add support for the SCM_RIGHTS control message used in communication
with the privops helper.

5 years agotest: accept test result if RTC can't enable RTC_UIE_ON
Christian Ehrhardt [Thu, 12 Dec 2019 11:06:39 +0000 (12:06 +0100)] 
test: accept test result if RTC can't enable RTC_UIE_ON

The test might run on different platforms. If the platform happens
to have a RTC that does exist but unable to have RTC_UIE_ON set the
test will fail, while the chrony code is actually good.

Examples of bad clocks are:
- ppc64el: rtc-generic
- arm64: rtc-efi

To avoid that extend the log message check on 101-rtc to accept
that condition as a valid test result as well.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
5 years agortc: extend check for RTCs that don't support interrupts
Christian Ehrhardt [Thu, 12 Dec 2019 11:06:40 +0000 (12:06 +0100)] 
rtc: extend check for RTCs that don't support interrupts

Several RTCs would only expose the broken behavior on enabling
interrupts. The reason for that is that the kernel only returns the
error if the state changes. Therefore the check has to probe
switch_interrupts(1) as well.

On platforms that work it will be switched on and off, while on those it
never works it will just stay off.

Clocks known to expose that behavior include, but are not limited to:
PPC64# dmesg | grep -i rtc   
[    0.241872] rtc-generic rtc-generic: registered as rtc0
[    0.270221] rtc-generic rtc-generic: setting system clock to ...
ARM64# dmesg | grep -i rtc
[    0.876198] rtc-efi rtc-efi: registered as rtc0
[    1.046869] rtc-efi rtc-efi: setting system clock to ...

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
5 years agortc: disable interrupts in finalization
Miroslav Lichvar [Tue, 10 Dec 2019 16:42:34 +0000 (17:42 +0100)] 
rtc: disable interrupts in finalization

Don't leave interrupts enabled if chronyd is stopped when making an RTC
measurement.

5 years agortc: handle RTCs that don't support interrupts
Miroslav Lichvar [Tue, 10 Dec 2019 16:33:17 +0000 (17:33 +0100)] 
rtc: handle RTCs that don't support interrupts

Some RTCs supported by the Linux kernel don't support the RTC_UIE_ON/OFF
ioctls, which causes chronyd started with the -s option to get stuck in
the initial RTC mode.

After opening the RTC device in the initialization, return error if
the ioctls are not supported to prevent the upper layer from calling the
time_init() function and expecting it to finish.

5 years agortc: don't finalize driver if initialization failed
Miroslav Lichvar [Tue, 10 Dec 2019 16:30:42 +0000 (17:30 +0100)] 
rtc: don't finalize driver if initialization failed

5 years agortc: simplify and move switch_interrupts()
Miroslav Lichvar [Tue, 10 Dec 2019 16:40:44 +0000 (17:40 +0100)] 
rtc: simplify and move switch_interrupts()

5 years agotest: update log checks in system tests
Miroslav Lichvar [Tue, 10 Dec 2019 14:54:36 +0000 (15:54 +0100)] 
test: update log checks in system tests

Measurements are no longer accepted and clock updated when polling
itself.

This fixes commit 7a88e0a87b3b2d3efbd7726451ef71b257e27673.

5 years agosys_linux: allow clock_adjtime in seccomp filter
Miroslav Lichvar [Mon, 2 Dec 2019 11:47:13 +0000 (12:47 +0100)] 
sys_linux: allow clock_adjtime in seccomp filter

The adjtimex() function in glibc was switched to the clock_adjtime
system call.

5 years agologging: enable line buffering on stderr
Miroslav Lichvar [Wed, 20 Nov 2019 09:47:16 +0000 (10:47 +0100)] 
logging: enable line buffering on stderr

This should avoid mixed lines on console or in file log when multiple
processes will be logging messages at the same time.

5 years agodoc: fix typo in chrony.conf man page
Vincent Blut [Thu, 28 Nov 2019 15:06:45 +0000 (16:06 +0100)] 
doc: fix typo in chrony.conf man page

5 years agologging: disable all debug messages in non-debug build
Miroslav Lichvar [Tue, 19 Nov 2019 13:59:21 +0000 (14:59 +0100)] 
logging: disable all debug messages in non-debug build

For consistency, don't print debug messages that are compiled in due to
using the LOG macro instead of DEBUG_LOG.

5 years agoclient: don't print log messages with lower severity
Miroslav Lichvar [Tue, 19 Nov 2019 13:21:53 +0000 (14:21 +0100)] 
client: don't print log messages with lower severity

5 years agoprivops: keep stdin/out/err open
Miroslav Lichvar [Mon, 18 Nov 2019 17:15:07 +0000 (18:15 +0100)] 
privops: keep stdin/out/err open

5 years agoprivops: remove debug message from PRV_Name2IPAddress()
Miroslav Lichvar [Mon, 11 Nov 2019 16:59:26 +0000 (17:59 +0100)] 
privops: remove debug message from PRV_Name2IPAddress()

The function may be called from a separate thread, but logging is not
considered thread safe (e.g. due to using functions which read
environment variables).

5 years agomain: don't try to open unspecified pidfile
Miroslav Lichvar [Tue, 12 Nov 2019 17:10:25 +0000 (18:10 +0100)] 
main: don't try to open unspecified pidfile

5 years agoswitch to new util file functions
Miroslav Lichvar [Tue, 22 Oct 2019 16:06:25 +0000 (18:06 +0200)] 
switch to new util file functions

Replace all fopen(), rename(), and unlink() calls with the new util
functions.

5 years agotest: extend util unit test
Miroslav Lichvar [Thu, 24 Oct 2019 08:54:37 +0000 (10:54 +0200)] 
test: extend util unit test

5 years agosys_linux: allow F_GETFL in seccomp filter
Miroslav Lichvar [Thu, 24 Oct 2019 10:42:02 +0000 (12:42 +0200)] 
sys_linux: allow F_GETFL in seccomp filter

This is needed for fdopen().

5 years agoutil: add functions for common file operations
Miroslav Lichvar [Tue, 22 Oct 2019 16:06:15 +0000 (18:06 +0200)] 
util: add functions for common file operations

Add a function to open a file for reading, writing, or appending.
In uppercase modes errors are handled as fatal, i.e. the caller doesn't
need to check for NULL. To avoid string manipulations in the callers,
the function accepts an optional directory and suffix. New files are
created with specified permissions, which will be needed for saving
keys. The O_EXCL flag is used in the writing mode to make sure a new
file is created (on filesystems that support it).

Also, add a function to rename a temporary file by changing its suffix,
and a function to remove a file.

All functions log all errors, at least as debug messages.

5 years agortc: don't clone file attributes of rtc file
Miroslav Lichvar [Tue, 22 Oct 2019 12:50:00 +0000 (14:50 +0200)] 
rtc: don't clone file attributes of rtc file

When replacing an existing rtc file with the temporary file, don't
change the ownership or permissions of the temporary file to match the
old rtc file, as if it didn't exist.

5 years agoreference: don't clone file attributes of drift file
Miroslav Lichvar [Tue, 22 Oct 2019 10:31:03 +0000 (12:31 +0200)] 
reference: don't clone file attributes of drift file

When replacing an existing drift file with the temporary file, don't
change the ownership or permissions of the temporary file to match the
old drift file, as if it didn't exist.

5 years agouse PATH_MAX
Miroslav Lichvar [Thu, 10 Oct 2019 15:53:58 +0000 (17:53 +0200)] 
use PATH_MAX

Include <limits.h> and use the PATH_MAX macro to define the length of
buffers containing paths to make it constistent. (It's not supposed to
fit all possible paths.)

5 years agologging: include <syslog.h>
Miroslav Lichvar [Wed, 23 Oct 2019 15:23:35 +0000 (17:23 +0200)] 
logging: include <syslog.h>

Move the inclusion of <syslog.h> from sysincl.h to logging.c to avoid
accidentally using the LOG_* constants from the header.

5 years agologging: make banner printing safer
Miroslav Lichvar [Tue, 22 Oct 2019 13:25:03 +0000 (15:25 +0200)] 
logging: make banner printing safer

Don't rely on the buffer filled with '=' characters to be always at
least as long as the log-specific banner string.

5 years agologging: call exit() in LOG_Message()
Miroslav Lichvar [Thu, 10 Oct 2019 13:07:10 +0000 (15:07 +0200)] 
logging: call exit() in LOG_Message()

Call exit() in LOG_Message() after printing a fatal message to allow the
LOG macro or LOG_Message() to be used directly instead of the LOG_FATAL
macro.

5 years agotest: extend 110-chronyc test
Miroslav Lichvar [Tue, 24 Sep 2019 09:29:35 +0000 (11:29 +0200)] 
test: extend 110-chronyc test

5 years agotest: extend 105-ntpauth test
Miroslav Lichvar [Thu, 19 Sep 2019 15:38:22 +0000 (17:38 +0200)] 
test: extend 105-ntpauth test

5 years agotest: extend keys unit test
Miroslav Lichvar [Thu, 19 Sep 2019 15:47:53 +0000 (17:47 +0200)] 
test: extend keys unit test

5 years agotest: add cmac unit test
Miroslav Lichvar [Mon, 23 Sep 2019 12:38:57 +0000 (14:38 +0200)] 
test: add cmac unit test

5 years agoclient: add CMAC support to keygen command
Miroslav Lichvar [Thu, 19 Sep 2019 11:17:20 +0000 (13:17 +0200)] 
client: add CMAC support to keygen command

Allow a CMAC cipher to be specified in the keygen command. Ignore the
specified length as the key length is determined by the cipher.

5 years agokeys: add support for CMAC keys
Miroslav Lichvar [Tue, 17 Sep 2019 14:59:55 +0000 (16:59 +0200)] 
keys: add support for CMAC keys

Allow a cipher (AES128 or AES256) to be specified as the type of a key
in the key file to authenticate NTP packets with a CMAC instead of the
NTPv4 (RFC 5905) MAC using a hash function. This follows RFC 8573.

5 years agocmac: add support for Nettle
Miroslav Lichvar [Tue, 17 Sep 2019 14:58:31 +0000 (16:58 +0200)] 
cmac: add support for Nettle

Add support for AES128 and AES256 CMAC in Nettle.

5 years agocmac: add CMAC interface
Miroslav Lichvar [Tue, 17 Sep 2019 14:57:03 +0000 (16:57 +0200)] 
cmac: add CMAC interface

Add cmac.h and stubs for cipher-based message authentication code
(CMAC).

5 years agokeys: don't fudge authentication delay
Miroslav Lichvar [Mon, 23 Sep 2019 15:58:27 +0000 (17:58 +0200)] 
keys: don't fudge authentication delay

Remove the magic constant compensating for copying, conversions, etc.
It cannot possibly be accurate on all hardware. The delay is supposed to
be a minimum delay.

5 years agohash: drop support for RIPEMD hash functions
Miroslav Lichvar [Tue, 17 Sep 2019 14:51:39 +0000 (16:51 +0200)] 
hash: drop support for RIPEMD hash functions

An analysis by Tim Ruffing [1] shows that a length extension attack
adding valid extension fields to NTPv4 packets is possible with some
specific key lengths and hash functions using little-endian length like
MD5 and RIPEMD160.

chronyd currently doesn't process or generate any extension fields, but
it could be a problem in future when a non-authentication extension
field is supported.

Drop support for all RIPEMD functions as they don't seem to be secure in
the context of the NTPv4 MAC. MD5 is kept only for compatibility.

[1] https://mailarchive.ietf.org/arch/msg/ntp/gvibuB6bTbDRBumfHNdJ84Kq4kA

5 years agomakefile: improve coding style
Miroslav Lichvar [Thu, 19 Sep 2019 10:25:39 +0000 (12:25 +0200)] 
makefile: improve coding style

5 years agomakefile: refactor to support extra client-specific objects
Miroslav Lichvar [Thu, 19 Sep 2019 10:08:03 +0000 (12:08 +0200)] 
makefile: refactor to support extra client-specific objects

5 years agoconfigure: move duplicated libraries to LIBS
Miroslav Lichvar [Thu, 19 Sep 2019 10:55:35 +0000 (12:55 +0200)] 
configure: move duplicated libraries to LIBS

5 years agoconfigure: remove unused variables
Miroslav Lichvar [Thu, 19 Sep 2019 10:03:12 +0000 (12:03 +0200)] 
configure: remove unused variables

5 years agotest: disable server on client-only nodes by default
Miroslav Lichvar [Wed, 11 Sep 2019 17:26:51 +0000 (19:26 +0200)] 
test: disable server on client-only nodes by default

5 years agotest: add 138-syncloop test
Miroslav Lichvar [Wed, 11 Sep 2019 16:49:02 +0000 (18:49 +0200)] 
test: add 138-syncloop test

5 years agotest: allow nodes to poll themselves
Miroslav Lichvar [Thu, 5 Sep 2019 15:30:17 +0000 (17:30 +0200)] 
test: allow nodes to poll themselves

5 years agotest: remove subdirectories in tmp directory
Miroslav Lichvar [Thu, 5 Sep 2019 15:29:36 +0000 (17:29 +0200)] 
test: remove subdirectories in tmp directory

5 years agontp: skip loop test if no server socket is open
Miroslav Lichvar [Wed, 11 Sep 2019 16:35:29 +0000 (18:35 +0200)] 
ntp: skip loop test if no server socket is open

If there is no socket that could receive a request from a client or
peer, we know that nothing can be synchronized to us and no loop is
possible.

5 years agontp: prevent synchronization to itself
Miroslav Lichvar [Thu, 5 Sep 2019 15:30:50 +0000 (17:30 +0200)] 
ntp: prevent synchronization to itself

Improve the client's test D to compare the stratum, reference ID,
reference timestamp, and root delay from the received packet with its
own reference data in order to prevent it from synchronizing to itself,
e.g. due to a misconfiguration.

5 years agoreference: make local reference timestamp consistent
Miroslav Lichvar [Thu, 5 Sep 2019 15:14:30 +0000 (17:14 +0200)] 
reference: make local reference timestamp consistent

In the local reference mode, instead of returning the adjusted current
time as the reference time, return the same timestamp updated only once
per about 62.5 seconds.

This will enable chronyd to detect polling of itself even when the local
reference mode is active.

5 years agoreference: rework adjustment of reference timestamp
Miroslav Lichvar [Thu, 5 Sep 2019 15:03:38 +0000 (17:03 +0200)] 
reference: rework adjustment of reference timestamp

Instead of converting the reference timestamp to the NTP format and
back, add a negative double value to the timestamp directly. Move the
code to a separate function. This will allow the timestamp to stay
outside the compiled-in NTP era, which is useful for testing of the
cmdmon protocol.

5 years agotest: extend 110-chronyc test
Miroslav Lichvar [Tue, 3 Sep 2019 10:41:05 +0000 (12:41 +0200)] 
test: extend 110-chronyc test

5 years agotest: add 137-pool test
Miroslav Lichvar [Mon, 2 Sep 2019 15:21:43 +0000 (17:21 +0200)] 
test: add 137-pool test

5 years agotest: add 013-nameserv test
Miroslav Lichvar [Mon, 2 Sep 2019 14:32:58 +0000 (16:32 +0200)] 
test: add 013-nameserv test

5 years agotest: add option to enable name/address resolving
Miroslav Lichvar [Mon, 2 Sep 2019 14:25:42 +0000 (16:25 +0200)] 
test: add option to enable name/address resolving

5 years agotest: add copyright header to util unit test
Miroslav Lichvar [Wed, 21 Aug 2019 14:36:12 +0000 (16:36 +0200)] 
test: add copyright header to util unit test

5 years agotest: extend 105-ntpauth test
Miroslav Lichvar [Mon, 19 Aug 2019 13:56:18 +0000 (15:56 +0200)] 
test: extend 105-ntpauth test

5 years agotest: add debug message to ntp unit test
Miroslav Lichvar [Thu, 15 Aug 2019 16:46:04 +0000 (18:46 +0200)] 
test: add debug message to ntp unit test

5 years agontp: update setting of socket option
Miroslav Lichvar [Wed, 21 Aug 2019 07:12:33 +0000 (09:12 +0200)] 
ntp: update setting of socket option

5 years agosocket: add support for TCP sockets
Miroslav Lichvar [Tue, 6 Aug 2019 16:33:06 +0000 (18:33 +0200)] 
socket: add support for TCP sockets

TCP sockets will be needed for NTS key establishment.

6 years agosocket: fix typo in union declaration
Miroslav Lichvar [Tue, 6 Aug 2019 15:50:37 +0000 (17:50 +0200)] 
socket: fix typo in union declaration

6 years agoutil: add debug messages to UTI_FdSetCloexec()
Miroslav Lichvar [Thu, 8 Aug 2019 15:32:23 +0000 (17:32 +0200)] 
util: add debug messages to UTI_FdSetCloexec()

6 years agomakefile: clean unit tests in clean target
Miroslav Lichvar [Tue, 6 Aug 2019 13:59:05 +0000 (15:59 +0200)] 
makefile: clean unit tests in clean target

6 years agodoc: improve ntpdate answer in FAQ
Miroslav Lichvar [Mon, 5 Aug 2019 16:15:38 +0000 (18:15 +0200)] 
doc: improve ntpdate answer in FAQ

6 years agosourcestats: report offset even with single sample
Miroslav Lichvar [Tue, 6 Aug 2019 13:54:38 +0000 (15:54 +0200)] 
sourcestats: report offset even with single sample

6 years agosourcestats: simplify SST_DoSourcestatsReport()
Miroslav Lichvar [Tue, 6 Aug 2019 12:00:17 +0000 (14:00 +0200)] 
sourcestats: simplify SST_DoSourcestatsReport()

6 years agotest: extend 130-quit test
Miroslav Lichvar [Mon, 5 Aug 2019 16:03:11 +0000 (18:03 +0200)] 
test: extend 130-quit test

6 years agosourcestats: enable selection with maxsamples < 3
Miroslav Lichvar [Mon, 5 Aug 2019 15:53:00 +0000 (17:53 +0200)] 
sourcestats: enable selection with maxsamples < 3

Setting maxsamples to 1 or 2 prevented the source from being selected as
the regression would always fail. Handle this as a special case with
disabled frequency tracking in order to enable a fast reference update
with the -q/-Q option.

6 years agosourcestats: update offset estimate when regression fails
Miroslav Lichvar [Mon, 5 Aug 2019 13:25:04 +0000 (15:25 +0200)] 
sourcestats: update offset estimate when regression fails

If there are too few samples to make a regression, at least update the
offset estimate from the last sample and keep the previous frequency
offset unchanged. Also, reset the error estimates.

6 years agosocket: fix compiler warning
Miroslav Lichvar [Thu, 25 Jul 2019 07:52:33 +0000 (09:52 +0200)] 
socket: fix compiler warning

Don't define check_socket_flag() if no supported socket flag is defined.

6 years agosocket: avoid unnecessary bind() call
Miroslav Lichvar [Wed, 24 Jul 2019 09:46:39 +0000 (11:46 +0200)] 
socket: avoid unnecessary bind() call

Don't call bind() if the specified local address of a socket has port 0
and the "any" address. It will be bound automatically on connect() or
sendmsg().

6 years agosocket: add support for socket() flags
Miroslav Lichvar [Tue, 23 Jul 2019 15:26:29 +0000 (17:26 +0200)] 
socket: add support for socket() flags

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

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

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

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

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

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

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

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

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

It is no longer used after the conversions.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This fixes commit 1227873b8810ed0f82d4b85a3c19c9562fda0b91.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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