]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
9 years agoutil: add function for dropping root privileges
Miroslav Lichvar [Tue, 8 Dec 2015 16:16:45 +0000 (17:16 +0100)] 
util: add function for dropping root privileges

Share the code for dropping supplementary groups and setting effective,
saved, and real user UID/GID between system drivers.

9 years agomain: initialise privops sooner
Miroslav Lichvar [Wed, 9 Dec 2015 13:59:12 +0000 (14:59 +0100)] 
main: initialise privops sooner

System drivers may need it in their initialisation.

9 years agosys_macosx: fix adjustment correction after step
Bryan Christianson [Wed, 9 Dec 2015 07:11:06 +0000 (20:11 +1300)] 
sys_macosx: fix adjustment correction after step

The desired offset was being added to the current time instead of being
subtracted.

9 years agomain: fix compiler warning
Miroslav Lichvar [Tue, 8 Dec 2015 16:37:01 +0000 (17:37 +0100)] 
main: fix compiler warning

9 years agosys_netbsd: use privileged helper for socket binding
Miroslav Lichvar [Tue, 8 Dec 2015 16:19:33 +0000 (17:19 +0100)] 
sys_netbsd: use privileged helper for socket binding

When dropping root privileges, start the helper to allow binding
of server sockets later.

9 years agoconfigure: rework setting of privops macros
Miroslav Lichvar [Tue, 8 Dec 2015 15:43:08 +0000 (16:43 +0100)] 
configure: rework setting of privops macros

Prepare a list of required privileged operations first and from that
define the PRIVOPS macros. This will reduce the amount of code that will
be needed when the privileged helper is used on other platforms.

9 years agoconfigure: fix check of date output
Miroslav Lichvar [Tue, 8 Dec 2015 11:55:05 +0000 (12:55 +0100)] 
configure: fix check of date output

9 years agoprivops: refactor initialisation/finalisation
Miroslav Lichvar [Tue, 8 Dec 2015 13:10:29 +0000 (14:10 +0100)] 
privops: refactor initialisation/finalisation

Rename PRV_Initialise() to PRV_StartHelper() and add a new
initialisation function, which just sets the helper fd to -1. Move
the initialision/finalisation calls from the system drivers to main.c.
If privops is not included in the build, define empty macros for the
function names, so their calls don't have to be wrapped in #ifdefs.

9 years agoprivops: wait for helper pid
Miroslav Lichvar [Tue, 8 Dec 2015 15:09:02 +0000 (16:09 +0100)] 
privops: wait for helper pid

Save the pid of the helper process and replace wait() with waitpid().

9 years agoprivops: stop helper on exit
Miroslav Lichvar [Tue, 8 Dec 2015 10:10:52 +0000 (11:10 +0100)] 
privops: stop helper on exit

With SOCK_DGRAM sockets, the helper doesn't stop as there is no error
received when the socket is closed on the daemon side.

Add a QUIT operation to the protocol which is requested when the daemon
is exiting. It has no response. Register the stopping function with
atexit() to stop the helper even when the daemon is not exiting cleanly,
e.g. due to a fatal error.

9 years agoprivops: split send_to_helper()
Miroslav Lichvar [Tue, 8 Dec 2015 14:54:43 +0000 (15:54 +0100)] 
privops: split send_to_helper()

Split out the sending part of the function into send_request() and
rename it to submit_request(). This will be useful to send a request
without waiting for a response.

Also, remove the fd parameter from the functions and just use helper_fd
directly.

9 years agoprivops: use SOCK_SEQPACKET sockets when supported
Miroslav Lichvar [Tue, 8 Dec 2015 09:20:20 +0000 (10:20 +0100)] 
privops: use SOCK_SEQPACKET sockets when supported

SOCK_SEQPACKET is preferred over SOCK_DGRAM for communication with the
helper as the process will get an error when the other end of the socket
is closed. It's not supported on all platforms.

If SOCK_SEQPACKET is defined, try creating the pair of sockets with this
type first and if that fails, fall back to SOCK_DGRAM.

9 years agosys_linux: allow mremap in seccomp filter
Miroslav Lichvar [Fri, 4 Dec 2015 11:51:28 +0000 (12:51 +0100)] 
sys_linux: allow mremap in seccomp filter

9 years agosys_macosx: synchronise RTC from system time
Bryan Christianson [Thu, 3 Dec 2015 11:15:49 +0000 (00:15 +1300)] 
sys_macosx: synchronise RTC from system time

When the rtcsync directive is specified in the chronyd config file,
chronyd will update the RTC via settimeofday() every 60 minutes if
the system time is synchronised to NTP.

9 years agoclient: print invalid intervals as dash
Miroslav Lichvar [Wed, 2 Dec 2015 17:21:07 +0000 (18:21 +0100)] 
client: print invalid intervals as dash

Instead of printing some large arbitrary values use dash in the LastRx
column of the sources output and the Last/Int columns in the clients
output when no sample or hit is recorded.

9 years agosourcestats: use maximum value as invalid age in source report
Miroslav Lichvar [Wed, 2 Dec 2015 17:10:22 +0000 (18:10 +0100)] 
sourcestats: use maximum value as invalid age in source report

9 years agoclientlog: fix counting of command drops
Miroslav Lichvar [Wed, 2 Dec 2015 18:14:19 +0000 (19:14 +0100)] 
clientlog: fix counting of command drops

9 years agoclientlog: save time of last hit with sub-second resolution
Miroslav Lichvar [Wed, 2 Dec 2015 16:49:40 +0000 (17:49 +0100)] 
clientlog: save time of last hit with sub-second resolution

Instead of time_t use a 32-bit fixed point representation with 4-bit
fraction to save the time of the last hit. The rate can now be measured
up to 16 packets per second. Maximum interval between hits is about 4
years.

9 years agoconf: inline one-line parse_* functions
Miroslav Lichvar [Wed, 2 Dec 2015 11:51:15 +0000 (12:51 +0100)] 
conf: inline one-line parse_* functions

9 years agomain: assert supported integer size, representation and conversion
Miroslav Lichvar [Wed, 2 Dec 2015 11:18:01 +0000 (12:18 +0100)] 
main: assert supported integer size, representation and conversion

Abort immediately on start if chronyd is compiled on a platform with int
shorter than 32 bits, using other representation than two's complement,
or unexpected conversion of large unsigned integers to signed.

9 years agofix undefined shift operations on signed integers
Miroslav Lichvar [Wed, 2 Dec 2015 11:06:01 +0000 (12:06 +0100)] 
fix undefined shift operations on signed integers

9 years agoarray: always return non-NULL pointer from ARR_GetElements()
Miroslav Lichvar [Tue, 1 Dec 2015 13:24:36 +0000 (14:24 +0100)] 
array: always return non-NULL pointer from ARR_GetElements()

Some libc calls like memcpy() expect the pointer to be valid even when
the size is zero and there is nothing to do. Instead of checking the
size before all such calls, modify ARR_GetElements() to return a pointer
to the array instance itself if data was not allocated yet.

9 years agocontrib: update chronylogrotate.sh script
Bryan Christianson [Sun, 29 Nov 2015 21:13:03 +0000 (10:13 +1300)] 
contrib: update chronylogrotate.sh script

1. Remove obsolete options when running chronyc
2. Add copyright/licence notice
3. Use logger utility to print/store error messages

9 years agocmdmon: update CLIENT_ACCESSES_BY_INDEX command
Miroslav Lichvar [Fri, 27 Nov 2015 14:25:24 +0000 (15:25 +0100)] 
cmdmon: update CLIENT_ACCESSES_BY_INDEX command

Add new fields from clientlog to the report and print them in chronyc.
Rework the code to skip empty records in the hash table. The reply no
longer has variable length, all client fields are filled even if some
are empty. Reply with RPY_NULL when the facility is disabled.

9 years agoclientlog: limit response rate
Miroslav Lichvar [Wed, 25 Nov 2015 12:23:52 +0000 (13:23 +0100)] 
clientlog: limit response rate

When the measured NTP or command request rate of a client exceeds
a threshold, reply only to a small fraction of the requests to reduce
the network traffic. Clients are allowed to send a burst of requests.
Try to detect broken clients which increase the request rate when not
getting replies and suppress the rate limiting for them.

Add ratelimit and cmdratelimit directives to configure the thresholds,
bursts and leak rates independently for NTP and command response rate
limiting. Both are disabled by default. Commands from localhost are
never limited.

9 years agoclientlog: measure request rates
Miroslav Lichvar [Wed, 25 Nov 2015 08:57:12 +0000 (09:57 +0100)] 
clientlog: measure request rates

Extend the record with estimates of the current client's NTP and command
request rates. Store them as 8-bit scaled log2 values to save memory.

9 years agoclientlog: store records in hash table instead of tree
Miroslav Lichvar [Tue, 24 Nov 2015 13:51:15 +0000 (14:51 +0100)] 
clientlog: store records in hash table instead of tree

This simplifies the code and allows older records to be reused when no
more memory can be allocated for new addresses. Each slot of the hash
table has 16 records and there is no chaining between different slots.
Reused records may be newer than records in other slots, but the search
time remains constant.

9 years agoclientlog: reduce amount of logged information
Miroslav Lichvar [Mon, 23 Nov 2015 14:53:45 +0000 (15:53 +0100)] 
clientlog: reduce amount of logged information

Don't log NTP peer access and auth/bad command access. Also, change
types for logging number of hits from long to uint32_t. This reduces the
size of the node and allows more clients to be monitored in the same
amount of memory.

9 years agoconf: don't allow disabling clientloglimit
Miroslav Lichvar [Tue, 24 Nov 2015 11:30:54 +0000 (12:30 +0100)] 
conf: don't allow disabling clientloglimit

Don't treat zero as a special value disabling clientloglimit. It's not
useful, the amount of available memory is never unlimited.

9 years agoutil: add macros for maximum, minimum and clamp
Miroslav Lichvar [Fri, 27 Nov 2015 10:03:16 +0000 (11:03 +0100)] 
util: add macros for maximum, minimum and clamp

If MAX/MIN are defined in system headers, undefine them first.

9 years agoutil: add function for IP address hashing
Miroslav Lichvar [Mon, 23 Nov 2015 14:24:33 +0000 (15:24 +0100)] 
util: add function for IP address hashing

Move the hashing function from find_slot() in ntp_sources to make it
available to clientlog and improve the hashing a bit.

9 years agocmdmon: tidy up declarations in read_from_cmd_socket()
Miroslav Lichvar [Thu, 26 Nov 2015 09:08:49 +0000 (10:08 +0100)] 
cmdmon: tidy up declarations in read_from_cmd_socket()

9 years agosys_macosx: tidy up includes
Bryan Christianson [Tue, 24 Nov 2015 09:07:58 +0000 (22:07 +1300)] 
sys_macosx: tidy up includes

Use "sysincl.h" in place of the common system include files

9 years agosys_macosx: drop root privileges
Bryan Christianson [Tue, 24 Nov 2015 08:01:59 +0000 (21:01 +1300)] 
sys_macosx: drop root privileges

Run chronyd as a non-privileged user, using the privops helper to
perform adjtime(), settimeofday() and bind() functions on its behalf.

9 years agoadd support for privilege separation
Bryan Christianson [Fri, 20 Nov 2015 10:43:19 +0000 (23:43 +1300)] 
add support for privilege separation

Privileged helper that will perform adjtime(), settimeofday(), bind() on
behalf of chronyd when running as non-root user.

9 years agosys_linux: allow ioctl(TCGETS) in seccomp filter
Miroslav Lichvar [Wed, 18 Nov 2015 11:42:38 +0000 (12:42 +0100)] 
sys_linux: allow ioctl(TCGETS) in seccomp filter

This seems to be needed to allow fopen() called on /dev/urandom to check
if it's a terminal.

9 years agoconf: don't allow invalid last refclock option
Miroslav Lichvar [Wed, 18 Nov 2015 11:21:23 +0000 (12:21 +0100)] 
conf: don't allow invalid last refclock option

9 years agontp: ignore poll in KoD RATE packets
Miroslav Lichvar [Mon, 16 Nov 2015 14:21:32 +0000 (15:21 +0100)] 
ntp: ignore poll in KoD RATE packets

The meaning of the poll value in KoD RATE packets is not currently
defined in the NTP specification (RFC 5905). In the reference NTP
implementation it signals the minimum acceptable polling interval to the
clients. In chrony the minimum poll is set to the KoD RATE poll if it's
larger, but not to a larger value than 10.

The problem is that ntpd as a server sets the KoD RATE poll to the
maximum of the client's poll and the configured rate limiting interval.
An attacker can send a burst of spoofed packets to the server to trigger
the client's request rate limit. When the client sends its next request
and the server responds with a KoD RATE packet, the client will set its
minimum poll to the current poll and it will no longer be able to switch
to a shorter poll when needed.

ntpd could be fixed to always set the KoD RATE poll to the rate limiting
interval. Unfortunately, ntpd as a client seems to depend on the current
behavior. It tries to follow the server poll and if the KoD RATE poll
was shorter than the current poll, the polling interval would be
reduced, defeating the purpose of KoD RATE. The server fix will probably
need to wait until clients are fixed and that could take a very long
time.

For now, ignore the poll value in KoD RATE packets. Just add an extra
delay based on the current poll to the next transmit timeout and stop an
ongoing burst.

9 years agodoc: update description of offline command
Miroslav Lichvar [Mon, 16 Nov 2015 13:50:57 +0000 (14:50 +0100)] 
doc: update description of offline command

Reachability and online/offline mode has no effect on source selection
since version 2.0.

9 years agontp: adjust initial delay for polling interval
Miroslav Lichvar [Mon, 16 Nov 2015 11:28:42 +0000 (12:28 +0100)] 
ntp: adjust initial delay for polling interval

First packet after setting a source to online was sent with constant
delay (0.2s). If the period in which the source was offline was shorter
than the current polling interval, the new packet was sent sooner than
it would be if the source wasn't switched to offline and back.

Don't reset the local tx timestamp when mode is changed. When starting
the initial transmit timeout, adjust the delay to make the interval
between the two packets at least as long as the current polling
interval.

9 years agosched: update timeout randomization
Miroslav Lichvar [Fri, 13 Nov 2015 15:08:02 +0000 (16:08 +0100)] 
sched: update timeout randomization

Use UTI_GetRandomBytes() instead of random() to calculate the random
part of the timeout. This was the only remaining use of random() in the
code and the srandom() call can be removed.

9 years agontp: don't reveal local clock in client packets
Miroslav Lichvar [Tue, 10 Nov 2015 16:59:49 +0000 (17:59 +0100)] 
ntp: don't reveal local clock in client packets

In client packets set the leap, stratum, reference ID, reference time,
root delay and root dispersion to constant values to not reveal the
state of the synchronization. Use precision 32 to make the receive and
transmit timestamps completely random and not reveal the local time.

9 years agoutil: rework timestamp fuzzing
Miroslav Lichvar [Tue, 10 Nov 2015 16:26:59 +0000 (17:26 +0100)] 
util: rework timestamp fuzzing

Use UTI_GetRandomBytes() instead of random() to generate random bits
below precision. Save the result in NTP_int64 in the network order and
allow precision in the full range from -32 to 32. With precision 32
the fuzzing now makes the timestamp completely random and can be used to
hide the time.

9 years agoutil: add function to generate random bytes
Miroslav Lichvar [Tue, 10 Nov 2015 15:46:40 +0000 (16:46 +0100)] 
util: add function to generate random bytes

Add a function to fill a buffer with random bytes which uses a better
PRNG than random(). Use arc4random() if it's available on the system.
Fall back to reading from /dev/urandom, which should be available on
all currently supported systems.

9 years agontp: don't keep client sockets open for longer than necessary
Miroslav Lichvar [Thu, 5 Nov 2015 15:43:40 +0000 (16:43 +0100)] 
ntp: don't keep client sockets open for longer than necessary

After sending a client packet, schedule a timeout to close the socket
at the time when all server replies would fail the delay test, so the
socket is not open for longer than necessary (e.g. when the server is
unreachable). With the default maxdelay of 3 seconds the timeout is 7
seconds.

9 years agontp: check remote interval in client mode
Miroslav Lichvar [Wed, 4 Nov 2015 14:47:40 +0000 (15:47 +0100)] 
ntp: check remote interval in client mode

For testA in the client mode require also that the time the server
needed to process the client request is not longer than 4 seconds.
With maximum peer delay this limits the interval in which the client can
accept a server reply.

9 years agosched: use shorter data type for timeout IDs
Miroslav Lichvar [Thu, 5 Nov 2015 12:14:57 +0000 (13:14 +0100)] 
sched: use shorter data type for timeout IDs

9 years agosched: don't allow SCH_RemoveTimeout() with invalid non-zero ID
Miroslav Lichvar [Tue, 10 Nov 2015 13:29:52 +0000 (14:29 +0100)] 
sched: don't allow SCH_RemoveTimeout() with invalid non-zero ID

9 years agosched: don't return currently used timeout ID
Miroslav Lichvar [Tue, 10 Nov 2015 13:41:19 +0000 (14:41 +0100)] 
sched: don't return currently used timeout ID

To avoid problems in the very unlikely case where a timeout is so long
and new IDs are allocated so frequently that they would have a chance
to overflow and catch up with it, make sure before returning new ID that
it's currently not in use.

9 years agosched: always return non-zero timeout ID
Miroslav Lichvar [Thu, 5 Nov 2015 13:29:11 +0000 (14:29 +0100)] 
sched: always return non-zero timeout ID

Timeout ID of zero can be now safely used to indicate that the timer is
not running. Remove the extra timer_running variables that were
necessary to track that.

9 years agosys_linux: allow more syscalls in seccomp filter
Miroslav Lichvar [Wed, 4 Nov 2015 13:53:00 +0000 (14:53 +0100)] 
sys_linux: allow more syscalls in seccomp filter

These seem to be needed by getaddrinfo() in default NSS configuration
on recent Fedora.

9 years agodoc: update NEWS 2.2
Miroslav Lichvar [Mon, 19 Oct 2015 09:17:16 +0000 (11:17 +0200)] 
doc: update NEWS

9 years agoconfigure: disable scfilter by default
Miroslav Lichvar [Mon, 19 Oct 2015 09:16:45 +0000 (11:16 +0200)] 
configure: disable scfilter by default

As an experimental feature it should be explicitly enabled.

9 years agoclient: add debug message for recv() error
Miroslav Lichvar [Thu, 15 Oct 2015 09:57:54 +0000 (11:57 +0200)] 
client: add debug message for recv() error

9 years agodoc: add minimum recommended configuration to FAQ
Miroslav Lichvar [Wed, 14 Oct 2015 14:44:06 +0000 (16:44 +0200)] 
doc: add minimum recommended configuration to FAQ

9 years agodoc: include chrony version in manual title
Miroslav Lichvar [Wed, 14 Oct 2015 12:43:47 +0000 (14:43 +0200)] 
doc: include chrony version in manual title

9 years agodoc: update comparison with ntpd
Miroslav Lichvar [Wed, 14 Oct 2015 12:08:21 +0000 (14:08 +0200)] 
doc: update comparison with ntpd

9 years agodoc: remove obsolete section on contributing
Miroslav Lichvar [Wed, 14 Oct 2015 11:52:35 +0000 (13:52 +0200)] 
doc: remove obsolete section on contributing

9 years agodoc: improve maxdistance description
Miroslav Lichvar [Wed, 14 Oct 2015 11:51:19 +0000 (13:51 +0200)] 
doc: improve maxdistance description

9 years agologging: don't ignore message severity with debug support
Miroslav Lichvar [Mon, 12 Oct 2015 11:16:04 +0000 (13:16 +0200)] 
logging: don't ignore message severity with debug support

The severity was fixed for all messages to LOGS_DEBUG. This was broken
in commit 7b2430fc3c44bc7f5fc3b6ca2b478cdea77ef841.

9 years agoconfigure: check for struct in_pktinfo with ipi_spec_dst
Miroslav Lichvar [Mon, 12 Oct 2015 09:44:21 +0000 (11:44 +0200)] 
configure: check for struct in_pktinfo with ipi_spec_dst

On NetBSD there is a struct in_pktinfo, but it doesn't have the
ipi_spec_dst field and it breaks compilation.

9 years agoconfigure: improve description of struct in6_pktinfo check
Miroslav Lichvar [Mon, 12 Oct 2015 09:29:13 +0000 (11:29 +0200)] 
configure: improve description of struct in6_pktinfo check

9 years agoconfigure: include IPV6_PKTINFO in struct in6_pktinfo check
Miroslav Lichvar [Mon, 12 Oct 2015 09:22:27 +0000 (11:22 +0200)] 
configure: include IPV6_PKTINFO in struct in6_pktinfo check

9 years agodoc: update NEWS 2.2-pre2
Miroslav Lichvar [Fri, 9 Oct 2015 11:36:59 +0000 (13:36 +0200)] 
doc: update NEWS

9 years agoexamples: use one-second check interval in chrony-wait.service
Miroslav Lichvar [Fri, 9 Oct 2015 11:36:02 +0000 (13:36 +0200)] 
examples: use one-second check interval in chrony-wait.service

9 years agoconfigure: make default hwclockfile configurable
Miroslav Lichvar [Thu, 8 Oct 2015 08:44:23 +0000 (10:44 +0200)] 
configure: make default hwclockfile configurable

9 years agortc: improve logging
Miroslav Lichvar [Thu, 8 Oct 2015 08:18:34 +0000 (10:18 +0200)] 
rtc: improve logging

Improve, shorten, or convert to debug log messages.

9 years agoclient: make waitsync check interval configurable
Miroslav Lichvar [Wed, 7 Oct 2015 10:44:25 +0000 (12:44 +0200)] 
client: make waitsync check interval configurable

9 years agortc: restore time from driftfile if later than RTC time
Miroslav Lichvar [Tue, 6 Oct 2015 13:52:36 +0000 (15:52 +0200)] 
rtc: restore time from driftfile if later than RTC time

This is useful on computers that have an RTC, but there is no battery to
keep the time when they are turned off and start with the same time on
each boot.

9 years agortc: don't run time_init function if pre_init failed
Miroslav Lichvar [Tue, 6 Oct 2015 11:23:14 +0000 (13:23 +0200)] 
rtc: don't run time_init function if pre_init failed

9 years agodoc: reduce makestep threshold in examples to 1 second
Miroslav Lichvar [Mon, 5 Oct 2015 08:12:50 +0000 (10:12 +0200)] 
doc: reduce makestep threshold in examples to 1 second

9 years agosys_linux: abort when loading seccomp rules fails
Miroslav Lichvar [Mon, 5 Oct 2015 07:56:58 +0000 (09:56 +0200)] 
sys_linux: abort when loading seccomp rules fails

9 years agodoc: update NEWS 2.2-pre1
Miroslav Lichvar [Thu, 1 Oct 2015 16:06:44 +0000 (18:06 +0200)] 
doc: update NEWS

9 years agodoc: update README
Miroslav Lichvar [Thu, 1 Oct 2015 11:25:40 +0000 (13:25 +0200)] 
doc: update README

9 years agoupdate copyright years
Miroslav Lichvar [Thu, 1 Oct 2015 12:23:32 +0000 (14:23 +0200)] 
update copyright years

9 years agoclient: remove unreachable code
Miroslav Lichvar [Thu, 1 Oct 2015 07:26:34 +0000 (09:26 +0200)] 
client: remove unreachable code

9 years agoclient: don't try sending request with invalid socket
Miroslav Lichvar [Wed, 30 Sep 2015 12:58:17 +0000 (14:58 +0200)] 
client: don't try sending request with invalid socket

9 years agoclient: don't shorten default timeout with ASYNCDNS
Miroslav Lichvar [Wed, 30 Sep 2015 12:20:49 +0000 (14:20 +0200)] 
client: don't shorten default timeout with ASYNCDNS

With connected sockets recv() should fail immediately if chronyd is not
listening on localhost and with the Unix socket connecting should fail.

9 years agostubs: add NSR_RefreshAddresses()
Miroslav Lichvar [Wed, 30 Sep 2015 11:33:06 +0000 (13:33 +0200)] 
stubs: add NSR_RefreshAddresses()

9 years agostubs: don't call DNS_Name2IPAddress handler directly
Miroslav Lichvar [Tue, 29 Sep 2015 15:39:27 +0000 (17:39 +0200)] 
stubs: don't call DNS_Name2IPAddress handler directly

Instead of calling the handler directly schedule a timeout with zero
delay for resolving to make the function behave similarly to the real
asynchronous resolver. This should prevent problems with code that
inadvertently depends on this behavior and which would break only when
compiled without support for asynchronous resolving.

9 years agoclient: improve signal handling
Miroslav Lichvar [Tue, 29 Sep 2015 15:11:38 +0000 (17:11 +0200)] 
client: improve signal handling

After receiving a signal, don't process new command from readline() and
break from waitsync command.

9 years agodoc: document refresh command
Miroslav Lichvar [Tue, 29 Sep 2015 14:27:38 +0000 (16:27 +0200)] 
doc: document refresh command

9 years agoclient: update help text
Miroslav Lichvar [Tue, 29 Sep 2015 14:18:06 +0000 (16:18 +0200)] 
client: update help text

9 years agocmdmon: add refresh command
Gautier PHILIPPON [Tue, 29 Sep 2015 14:08:43 +0000 (16:08 +0200)] 
cmdmon: add refresh command

This command can be used to resolve the names of configured sources to
IP addresses again.

9 years agoclient: fix compiler warning on extra printf argument
Miroslav Lichvar [Tue, 29 Sep 2015 08:07:26 +0000 (10:07 +0200)] 
client: fix compiler warning on extra printf argument

9 years agodoc: update for recent changes
Miroslav Lichvar [Fri, 25 Sep 2015 15:30:49 +0000 (17:30 +0200)] 
doc: update for recent changes

9 years agoclient: update help text
Miroslav Lichvar [Fri, 25 Sep 2015 14:02:04 +0000 (16:02 +0200)] 
client: update help text

Update the text for recent changes, add missing commands and indent the
description in the output.

9 years agologging: don't save debugging arguments when debug is disabled
Miroslav Lichvar [Thu, 24 Sep 2015 16:31:17 +0000 (18:31 +0200)] 
logging: don't save debugging arguments when debug is disabled

Don't save the facility number, line number, function name and filename
in the compiled binary unless the debugging support is enabled.

9 years agosys: use NetBSD driver on FreeBSD
Miroslav Lichvar [Tue, 22 Sep 2015 15:31:04 +0000 (17:31 +0200)] 
sys: use NetBSD driver on FreeBSD

The NetBSD driver now provides fast slewing using adjtime(), which
can be used on FreeBSD too.

9 years agosys_netbsd: add fast slewing based on adjtime()
Miroslav Lichvar [Tue, 22 Sep 2015 15:18:43 +0000 (17:18 +0200)] 
sys_netbsd: add fast slewing based on adjtime()

Implement slewing based on adjtime() that the generic driver can use to
correct offsets larger than 1 second with 5000 ppm slewing rate.

9 years agosys_generic: allow fast slewing with system driver
Miroslav Lichvar [Tue, 22 Sep 2015 15:12:15 +0000 (17:12 +0200)] 
sys_generic: allow fast slewing with system driver

The system drivers may implement their own slewing which the generic
driver can use to slew faster than the maximum frequency the driver is
allowed to set directly.

9 years agosys_solaris: use timex driver
Miroslav Lichvar [Fri, 18 Sep 2015 08:29:47 +0000 (10:29 +0200)] 
sys_solaris: use timex driver

Remove driver functions based on adjtime() and switch to the new timex
driver. The kernel allows the timex frequency to be set in the full
range of int32_t, which gives a maximum frequency of 32768 ppm. Round
the limit to 32500 ppm.

9 years agosys_timex: set timex constant on Solaris
Miroslav Lichvar [Fri, 18 Sep 2015 08:16:40 +0000 (10:16 +0200)] 
sys_timex: set timex constant on Solaris

The kernel apparently checks the constant even when it's not being set
with MOD_TIMECONST and may return EINVAL on an uninitialized value.

9 years agoclient: fix binding of Unix socket on Solaris
Miroslav Lichvar [Fri, 18 Sep 2015 10:05:44 +0000 (12:05 +0200)] 
client: fix binding of Unix socket on Solaris

bind() needs to be called before connect(), otherwise it fails with
EINVAL.

9 years agofix building on Solaris
Miroslav Lichvar [Fri, 18 Sep 2015 08:10:50 +0000 (10:10 +0200)] 
fix building on Solaris

- a feature test macro is needed to get msg_control in struct msghdr
- variables must not be named sun to avoid conflict with a macro
- res_init() needs -lresolv
- configure tests for IPv6 and getaddrinfo need -lsocket -lnsl
- pid_t is defined as long and needs to be cast for %d format

9 years agoclean up sysincl.h more
Miroslav Lichvar [Fri, 18 Sep 2015 08:07:56 +0000 (10:07 +0200)] 
clean up sysincl.h more

Define feature test macros in config.h if needed.

9 years agoconfigure: check if C compiler works
Miroslav Lichvar [Thu, 17 Sep 2015 11:51:18 +0000 (13:51 +0200)] 
configure: check if C compiler works

Check if the C compiler works to get a useful error message when it
doesn't or it's missing. If the CC environment variable is not set, try
gcc and then cc.

9 years agoconfigure: prefix error messages
Miroslav Lichvar [Thu, 17 Sep 2015 11:32:14 +0000 (13:32 +0200)] 
configure: prefix error messages

9 years agoconfigure: don't set any arch-specific CFLAGS
Miroslav Lichvar [Thu, 17 Sep 2015 11:03:04 +0000 (13:03 +0200)] 
configure: don't set any arch-specific CFLAGS

9 years agoconfigure: ignore architecture in system selection
Miroslav Lichvar [Thu, 17 Sep 2015 09:43:35 +0000 (11:43 +0200)] 
configure: ignore architecture in system selection

Assume chrony can be compiled and work on all architectures supported by
the operating systems.