]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
10 years agodoc: list server/peer options that can be set in chronyc
Miroslav Lichvar [Mon, 15 Dec 2014 17:20:31 +0000 (18:20 +0100)] 
doc: list server/peer options that can be set in chronyc

10 years agodoc: fix examples of add server and add peer commands
Miroslav Lichvar [Mon, 15 Dec 2014 17:19:30 +0000 (18:19 +0100)] 
doc: fix examples of add server and add peer commands

10 years agocmdparse: add function to convert error status to string
Miroslav Lichvar [Mon, 15 Dec 2014 16:59:42 +0000 (17:59 +0100)] 
cmdparse: add function to convert error status to string

This is used to avoid duplication of error printing in chronyd and
chronyc.

10 years agosys: use system headers for adjtimex
Miroslav Lichvar [Mon, 15 Dec 2014 16:23:15 +0000 (17:23 +0100)] 
sys: use system headers for adjtimex

10 years agosys: remove shift_hz
Miroslav Lichvar [Tue, 9 Dec 2014 16:58:42 +0000 (17:58 +0100)] 
sys: remove shift_hz

It's not used for anything since commit e147f2f1.

10 years agosys: remove TMX_ReadCurrentParams
Miroslav Lichvar [Tue, 9 Dec 2014 16:50:37 +0000 (17:50 +0100)] 
sys: remove TMX_ReadCurrentParams

10 years agosys: add sync status setting to generic and Linux driver
Miroslav Lichvar [Tue, 9 Dec 2014 16:31:10 +0000 (17:31 +0100)] 
sys: add sync status setting to generic and Linux driver

Set the adjtimex status, esterror and maxerror fields to the values
provided by the reference module.

10 years agosys: fix formatting in sys_linux.c
Miroslav Lichvar [Tue, 9 Dec 2014 16:26:30 +0000 (17:26 +0100)] 
sys: fix formatting in sys_linux.c

10 years agolocal: add new driver call to set synchronization status
Miroslav Lichvar [Tue, 9 Dec 2014 14:42:56 +0000 (15:42 +0100)] 
local: add new driver call to set synchronization status

This will be used to set the kernel adjtimex() variables to allow other
applications running on the system to know if the system clock is
synchronized and the estimated error and the maximum error.

10 years agoclient: add second form of makestep command
Miroslav Lichvar [Mon, 8 Dec 2014 16:54:08 +0000 (17:54 +0100)] 
client: add second form of makestep command

The second form configures the automatic stepping, similarly to the
makestep directive. It has two parameters, stepping threshold (in
seconds) and number of future clock updates for which will be the
threshold active. This can be used with the burst command to quickly
make a new measurement and correct the clock by stepping if needed,
without waiting for chronyd to complete the measurement and update the
clock.

10 years agocmdmon: initialize new source params when adding source
Miroslav Lichvar [Tue, 9 Dec 2014 10:35:01 +0000 (11:35 +0100)] 
cmdmon: initialize new source params when adding source

10 years agosources: allow setting minsamples and maxsamples for each source
Miroslav Lichvar [Mon, 1 Dec 2014 17:35:35 +0000 (18:35 +0100)] 
sources: allow setting minsamples and maxsamples for each source

The minsamples and maxsamples directives now set the default value,
which can be overriden for individual sources in the server/peer/pool
and refclock directives.

10 years agontp: don't replace source instance when changing address
Miroslav Lichvar [Mon, 1 Dec 2014 17:01:11 +0000 (18:01 +0100)] 
ntp: don't replace source instance when changing address

Add new functions to change source's reference ID/address and reset the
instance. Use that instead of destroying and creating a new instance
when the NTP address is changed.

10 years agontp: limit number of pool sources
Miroslav Lichvar [Wed, 26 Nov 2014 15:40:33 +0000 (16:40 +0100)] 
ntp: limit number of pool sources

A new option can be now used in the pool directive: maxsources sets the
maximum number of sources that can be used from the pool, the default
value is 4.

On start, when the pool name is resolved, chronyd will add up to 16
sources, one for each resolved address. When the number of sources from
which at least one valid reply was received reaches maxsources, the
other sources will be removed.

10 years agontp: update number of sources when removing all sources
Miroslav Lichvar [Mon, 24 Nov 2014 17:28:39 +0000 (18:28 +0100)] 
ntp: update number of sources when removing all sources

Also, rehash the records after removal and split cleaning of the source
record to a separate function.

10 years agontp: return status from NCR_ProcessKnown()
Miroslav Lichvar [Mon, 24 Nov 2014 15:14:04 +0000 (16:14 +0100)] 
ntp: return status from NCR_ProcessKnown()

10 years agodoc: update tempcomp description
Miroslav Lichvar [Fri, 21 Nov 2014 12:13:15 +0000 (13:13 +0100)] 
doc: update tempcomp description

10 years agotempcomp: allow configuration with list of points
Miroslav Lichvar [Fri, 21 Nov 2014 10:47:12 +0000 (11:47 +0100)] 
tempcomp: allow configuration with list of points

In addition to the quadratic function, allow configuration of the
compensation with a file containing list of (temperature, compensation)
points used for linear interpolation and extrapolation.

10 years agotest: fix 111-knownclient
Miroslav Lichvar [Fri, 21 Nov 2014 10:44:15 +0000 (11:44 +0100)] 
test: fix 111-knownclient

The new NTPv4 loop synchronization check fails as clknetsim doesn't
support IP_PKTINFO yet. Use the noselect option to prevent the server to
synchronize to the client.

10 years agontp: fix accepting requests from configured sources
Miroslav Lichvar [Fri, 21 Nov 2014 10:43:47 +0000 (11:43 +0100)] 
ntp: fix accepting requests from configured sources

When using server socket to send client requests (acquisitionport 123)
and currently not waiting for a reply, the socket check will fail for
client requests from the source.

The check needs to be moved to correctly handle the requests as from an
unknown source.

10 years agotempcomp: fix double free on sensor filename
Miroslav Lichvar [Tue, 4 Nov 2014 10:15:28 +0000 (11:15 +0100)] 
tempcomp: fix double free on sensor filename

This is related to commit f6ed7844e1ac8c25fe9ba84232c563f302beba30.

10 years agoconf: change default stratumweight to 0.001
Miroslav Lichvar [Mon, 3 Nov 2014 14:13:52 +0000 (15:13 +0100)] 
conf: change default stratumweight to 0.001

10 years agontp: support pools
Miroslav Lichvar [Mon, 3 Nov 2014 10:16:13 +0000 (11:16 +0100)] 
ntp: support pools

The pool directive can be used to configure chronyd for a pool of NTP
servers (e.g. pool.ntp.org). The name is expected to resolve to multiple
addresses which change over time.

On start, a source will be added for each resolved address. When a
source from the pool is unreachable or marked as falseticker, chronyd
will try to replace the source with a newly resolved address of the
pool.

The minimum interval between replacements is currently set to 244
seconds to avoid frequent DNS requests.

10 years agontp: allow changing address of core instance
Miroslav Lichvar [Fri, 31 Oct 2014 15:38:39 +0000 (16:38 +0100)] 
ntp: allow changing address of core instance

10 years agontp: try adding other server addresses
Miroslav Lichvar [Thu, 23 Oct 2014 13:20:14 +0000 (15:20 +0200)] 
ntp: try adding other server addresses

When adding a server from configuration file, don't give up when the
first returned address was already added for another server directive,
but try adding other addresses until one succeeds.

10 years agonameserv: add support for returning multiple addresses
Miroslav Lichvar [Tue, 21 Oct 2014 13:37:16 +0000 (15:37 +0200)] 
nameserv: add support for returning multiple addresses

10 years agonameserv: check that address returned from gethostbyname() is IPv4
Miroslav Lichvar [Tue, 21 Oct 2014 11:50:52 +0000 (13:50 +0200)] 
nameserv: check that address returned from gethostbyname() is IPv4

Also, always return failure with -6.

10 years agontp: take auto_offline sources offline before sending new request
Miroslav Lichvar [Thu, 23 Oct 2014 11:11:59 +0000 (13:11 +0200)] 
ntp: take auto_offline sources offline before sending new request

10 years agotest: add 116-minsources
Miroslav Lichvar [Mon, 20 Oct 2014 16:05:20 +0000 (18:05 +0200)] 
test: add 116-minsources

10 years agosources: add minsources option
Miroslav Lichvar [Mon, 20 Oct 2014 15:46:33 +0000 (17:46 +0200)] 
sources: add minsources option

This sets the minimum number of selectable sources needed to update the
local clock.

10 years agodocs: fix formatting of examples in server options
Miroslav Lichvar [Mon, 20 Oct 2014 14:17:38 +0000 (16:17 +0200)] 
docs: fix formatting of examples in server options

10 years agontp: add version option to server/peer directive
Miroslav Lichvar [Mon, 20 Oct 2014 14:12:39 +0000 (16:12 +0200)] 
ntp: add version option to server/peer directive

10 years agoconf: use array for broadcast destinations
Miroslav Lichvar [Mon, 20 Oct 2014 11:02:30 +0000 (13:02 +0200)] 
conf: use array for broadcast destinations

10 years agoconf: use arrays for NTP and cmdmon restrictions
Miroslav Lichvar [Mon, 20 Oct 2014 10:53:54 +0000 (12:53 +0200)] 
conf: use arrays for NTP and cmdmon restrictions

10 years agotest: add 009-sourceselection
Miroslav Lichvar [Mon, 20 Oct 2014 10:13:12 +0000 (12:13 +0200)] 
test: add 009-sourceselection

10 years agotest: add option to create falsetickers
Miroslav Lichvar [Mon, 20 Oct 2014 10:12:12 +0000 (12:12 +0200)] 
test: add option to create falsetickers

10 years agontp: remove debug messages in slew handler
Miroslav Lichvar [Fri, 17 Oct 2014 13:20:59 +0000 (15:20 +0200)] 
ntp: remove debug messages in slew handler

10 years agosourcestats: reduce debug messages in slew handler
Miroslav Lichvar [Fri, 17 Oct 2014 13:19:57 +0000 (15:19 +0200)] 
sourcestats: reduce debug messages in slew handler

10 years agosources: reset reachability for offline sources
Miroslav Lichvar [Fri, 17 Oct 2014 15:22:00 +0000 (17:22 +0200)] 
sources: reset reachability for offline sources

With the recent change allowing unreachable sources to remain selected,
offline sources will now be selectable only for some time, similarly to
online unreachable sources.

10 years agosources: allow selection of unreachable sources
Miroslav Lichvar [Fri, 17 Oct 2014 14:51:45 +0000 (16:51 +0200)] 
sources: allow selection of unreachable sources

Reachability is no longer a requirement for selection. An unreachable
source can remain selected if its newest sample is not older than the
oldest sample from all reachable sources.

This is useful to prevent reselection when an accurate source uses a
very short polling interval (e.g. refclock) and is occasionally
unreachable for short periods of time.

10 years agosources: extend source status tracking
Miroslav Lichvar [Fri, 17 Oct 2014 11:19:04 +0000 (13:19 +0200)] 
sources: extend source status tracking

Add new source states and rename some states so there is one state for
each reason a source can be rejected in the source selection.

This fixes reported status when sources are selectable, but the actual
selection was postponed until next update. It will also allow more
detailed reports when the cmdmon protocol is updated.

10 years agosources: fix reported normal select option
Miroslav Lichvar [Fri, 17 Oct 2014 11:05:44 +0000 (13:05 +0200)] 
sources: fix reported normal select option

10 years agosources: select only when reference can be updated
Miroslav Lichvar [Fri, 17 Oct 2014 08:18:39 +0000 (10:18 +0200)] 
sources: select only when reference can be updated

Before selecting the new synchronization source wait until the reference
can be updated, i.e. the source has new samples.

10 years agosources: drop selectable flag
Miroslav Lichvar [Thu, 16 Oct 2014 16:07:03 +0000 (18:07 +0200)] 
sources: drop selectable flag

This is no longer needed with new NTP packet processing as the sources
are always selectable after first sample is accumulated.

10 years agosources: reorder SRC_SelectSource()
Miroslav Lichvar [Thu, 16 Oct 2014 15:51:58 +0000 (17:51 +0200)] 
sources: reorder SRC_SelectSource()

Reorder the code to improve readability and also update coding style.
No functional changes.

10 years agosources: keep synchronized status with unreachable/unselectable sources
Miroslav Lichvar [Thu, 16 Oct 2014 14:26:05 +0000 (16:26 +0200)] 
sources: keep synchronized status with unreachable/unselectable sources

Following RFC 5905, don't call REF_SetUnsynchronised() when there are no
reachable or selectable sources. It's up to the client to consider the
source unsynchronized when the root distance exceeds a threshold.

The unsynchronized status is still set when no majority is reached.

10 years agosources: update reference only with new sample
Miroslav Lichvar [Thu, 16 Oct 2014 13:28:12 +0000 (15:28 +0200)] 
sources: update reference only with new sample

This follows the section 11.2.3. from RFC 5905.

10 years agontp: fix Clang warning
Miroslav Lichvar [Wed, 15 Oct 2014 10:39:54 +0000 (12:39 +0200)] 
ntp: fix Clang warning

10 years agontp: merge broadcast code with ntp_core
Miroslav Lichvar [Wed, 15 Oct 2014 10:25:56 +0000 (12:25 +0200)] 
ntp: merge broadcast code with ntp_core

10 years agontp: define NTP_MAX_STRATUM for other modules
Miroslav Lichvar [Tue, 14 Oct 2014 15:24:41 +0000 (17:24 +0200)] 
ntp: define NTP_MAX_STRATUM for other modules

10 years agodoc: update for NTPv4 support
Miroslav Lichvar [Mon, 13 Oct 2014 10:47:19 +0000 (12:47 +0200)] 
doc: update for NTPv4 support

10 years agoUpdate comments referencing RFC 1305
Miroslav Lichvar [Mon, 13 Oct 2014 10:49:40 +0000 (12:49 +0200)] 
Update comments referencing RFC 1305

10 years agontp: update packet processing to NTPv4 (RFC 5905)
Miroslav Lichvar [Mon, 13 Oct 2014 11:26:23 +0000 (13:26 +0200)] 
ntp: update packet processing to NTPv4 (RFC 5905)

10 years agontp: clamp value set by minstratum option
Miroslav Lichvar [Mon, 13 Oct 2014 11:28:15 +0000 (13:28 +0200)] 
ntp: clamp value set by minstratum option

10 years agosources: use correct specifier for refid in debug message
Miroslav Lichvar [Mon, 13 Oct 2014 10:50:44 +0000 (12:50 +0200)] 
sources: use correct specifier for refid in debug message

10 years agontp: print number of bytes sent in debug message
Miroslav Lichvar [Mon, 13 Oct 2014 11:28:45 +0000 (13:28 +0200)] 
ntp: print number of bytes sent in debug message

10 years agontp: enable PKTINFO on client sockets
Miroslav Lichvar [Wed, 8 Oct 2014 13:10:33 +0000 (15:10 +0200)] 
ntp: enable PKTINFO on client sockets

This will be useful to detect synchronization loops.

10 years agoutil: fix sockaddr function naming
Miroslav Lichvar [Fri, 3 Oct 2014 08:15:18 +0000 (10:15 +0200)] 
util: fix sockaddr function naming

10 years agoclient: improve sources caption
Miroslav Lichvar [Mon, 29 Sep 2014 09:29:51 +0000 (11:29 +0200)] 
client: improve sources caption

10 years agoutil: use common functions to convert to/from sockaddr
Miroslav Lichvar [Fri, 26 Sep 2014 15:49:07 +0000 (17:49 +0200)] 
util: use common functions to convert to/from sockaddr

10 years agoclient: print full date in manual list
Miroslav Lichvar [Fri, 26 Sep 2014 13:47:57 +0000 (15:47 +0200)] 
client: print full date in manual list

10 years agontp: fix NSR_TakeSourcesOffline()
Miroslav Lichvar [Fri, 26 Sep 2014 13:25:33 +0000 (15:25 +0200)] 
ntp: fix NSR_TakeSourcesOffline()

This was broken when switching to dynamic allocation in commit 9e7193.

10 years agokeys: store IDs in uint32_t
Miroslav Lichvar [Fri, 26 Sep 2014 12:14:54 +0000 (14:14 +0200)] 
keys: store IDs in uint32_t

10 years agologging: remove warning on missing debug messages
Miroslav Lichvar [Thu, 25 Sep 2014 07:46:44 +0000 (09:46 +0200)] 
logging: remove warning on missing debug messages

The state of the DEBUG feature is now printed with chronyd version.

10 years agocmdmon: fix initialization of allocated reply slots
Miroslav Lichvar [Wed, 24 Sep 2014 16:20:05 +0000 (18:20 +0200)] 
cmdmon: fix initialization of allocated reply slots

The next pointer in the last allocated reply slot was not set. This
could cause a crash when more slots were needed. (the slots are used to
save unacknowledged replies to authenticated commands)

10 years agocmdmon: allocate reply slots in smaller quantums
Miroslav Lichvar [Wed, 24 Sep 2014 15:56:08 +0000 (17:56 +0200)] 
cmdmon: allocate reply slots in smaller quantums

10 years agocmdmon: use char for permissions table
Miroslav Lichvar [Wed, 24 Sep 2014 14:58:16 +0000 (16:58 +0200)] 
cmdmon: use char for permissions table

10 years agorefclock: include refid in some debug messages
Miroslav Lichvar [Wed, 24 Sep 2014 14:36:45 +0000 (16:36 +0200)] 
refclock: include refid in some debug messages

10 years agoutil: optimize UTI_RefidToString()
Miroslav Lichvar [Wed, 24 Sep 2014 13:13:03 +0000 (15:13 +0200)] 
util: optimize UTI_RefidToString()

10 years agortc: allocate samples dynamically
Miroslav Lichvar [Wed, 24 Sep 2014 15:35:04 +0000 (17:35 +0200)] 
rtc: allocate samples dynamically

10 years agoconf: allocate sources dynamically
Miroslav Lichvar [Wed, 24 Sep 2014 12:59:20 +0000 (14:59 +0200)] 
conf: allocate sources dynamically

This removes the limits on maximum number of sources specified by the
initstepslew, server and refclock directives in the config file.

10 years agontp: allocate source records dynamically
Miroslav Lichvar [Wed, 24 Sep 2014 12:49:51 +0000 (14:49 +0200)] 
ntp: allocate source records dynamically

This removes the limit on maximum number of added NTP sources.

10 years agorefclocks: allocate refclock instances dynamically
Miroslav Lichvar [Wed, 24 Sep 2014 11:56:45 +0000 (13:56 +0200)] 
refclocks: allocate refclock instances dynamically

10 years agokeys: allocate keys dynamically
Miroslav Lichvar [Wed, 24 Sep 2014 11:47:52 +0000 (13:47 +0200)] 
keys: allocate keys dynamically

This removes the limit on maximum number of keys in the key file.

10 years agosched: allocate file handlers dynamically
Miroslav Lichvar [Wed, 24 Sep 2014 11:43:07 +0000 (13:43 +0200)] 
sched: allocate file handlers dynamically

10 years agosources: reallocate arrays in exponentially increasing sizes
Miroslav Lichvar [Wed, 24 Sep 2014 11:22:31 +0000 (13:22 +0200)] 
sources: reallocate arrays in exponentially increasing sizes

10 years agontp: improve hashing of sources
Miroslav Lichvar [Tue, 23 Sep 2014 15:12:56 +0000 (17:12 +0200)] 
ntp: improve hashing of sources

Use 32-bit hash and switch to quadratic probing. This will be useful to
allow resizing of the hash table and not limit the number of sources.

10 years agoAdd array utility functions
Miroslav Lichvar [Wed, 24 Sep 2014 09:31:33 +0000 (11:31 +0200)] 
Add array utility functions

10 years agoFree allocated memory on exit
Miroslav Lichvar [Tue, 23 Sep 2014 11:35:38 +0000 (13:35 +0200)] 
Free allocated memory on exit

This should reduce the number of possible memory leaks reported by
valgrind. The remaining reported leaks are sched tqe allocation, async
DNS instance allocation, cmdmon response/timestamp cell allocation, and
clientlog subnet allocation.

10 years agocmdparse: don't duplicate hostname in CPS_ParseNTPSourceAdd()
Miroslav Lichvar [Wed, 24 Sep 2014 10:41:38 +0000 (12:41 +0200)] 
cmdparse: don't duplicate hostname in CPS_ParseNTPSourceAdd()

Let the caller duplicate the string if needed.

10 years agoCheck for memory allocation errors
Miroslav Lichvar [Mon, 22 Sep 2014 14:09:35 +0000 (16:09 +0200)] 
Check for memory allocation errors

10 years agotest: make 114-presend more tolerant
Miroslav Lichvar [Tue, 23 Sep 2014 13:45:54 +0000 (15:45 +0200)] 
test: make 114-presend more tolerant

10 years agonameserv: move fallback DNS_Name2IPAddressAsync() to stubs.c
Miroslav Lichvar [Mon, 22 Sep 2014 10:51:19 +0000 (12:51 +0200)] 
nameserv: move fallback DNS_Name2IPAddressAsync() to stubs.c

10 years agoconfigure: add --disable-sechash option
Miroslav Lichvar [Fri, 19 Sep 2014 15:55:52 +0000 (17:55 +0200)] 
configure: add --disable-sechash option

10 years agoPrint enabled/disabled features with version
Miroslav Lichvar [Fri, 19 Sep 2014 15:46:34 +0000 (17:46 +0200)] 
Print enabled/disabled features with version

10 years agoconfigure: unify macro naming for optional features
Miroslav Lichvar [Fri, 19 Sep 2014 15:03:33 +0000 (17:03 +0200)] 
configure: unify macro naming for optional features

10 years agoconfigure: allow building without cmdmon, NTP, refclock support
Miroslav Lichvar [Fri, 19 Sep 2014 13:06:01 +0000 (15:06 +0200)] 
configure: allow building without cmdmon, NTP, refclock support

10 years agoconfigure: unify macro naming for available headers
Miroslav Lichvar [Fri, 19 Sep 2014 09:06:37 +0000 (11:06 +0200)] 
configure: unify macro naming for available headers

10 years agoconfigure: don't remove config files with --help
Miroslav Lichvar [Fri, 19 Sep 2014 08:13:42 +0000 (10:13 +0200)] 
configure: don't remove config files with --help

10 years agosourcestats: remove tracking of skew change
Miroslav Lichvar [Fri, 19 Sep 2014 08:07:03 +0000 (10:07 +0200)] 
sourcestats: remove tracking of skew change

This is not used since commit 7a6ee1d.

10 years agodoc: update NEWS 1.31
Miroslav Lichvar [Wed, 10 Sep 2014 13:06:55 +0000 (15:06 +0200)] 
doc: update NEWS

10 years agodoc: mention that directives are not case-sensitive
Miroslav Lichvar [Wed, 10 Sep 2014 12:47:50 +0000 (14:47 +0200)] 
doc: mention that directives are not case-sensitive

10 years agodoc: add section to FAQ on improving accuracy with NTP
Miroslav Lichvar [Wed, 10 Sep 2014 12:43:44 +0000 (14:43 +0200)] 
doc: add section to FAQ on improving accuracy with NTP

10 years agodoc: remove minpoll and maxpoll options from configuration example
Miroslav Lichvar [Wed, 10 Sep 2014 10:05:24 +0000 (12:05 +0200)] 
doc: remove minpoll and maxpoll options from configuration example

10 years agosched: fix Clang warning
Miroslav Lichvar [Wed, 10 Sep 2014 14:58:48 +0000 (16:58 +0200)] 
sched: fix Clang warning

10 years agoclient: describe error when could not open config or keyfile
Miroslav Lichvar [Wed, 10 Sep 2014 09:30:44 +0000 (11:30 +0200)] 
client: describe error when could not open config or keyfile

10 years agoIgnore measurements around leap second
Miroslav Lichvar [Tue, 9 Sep 2014 14:57:15 +0000 (16:57 +0200)] 
Ignore measurements around leap second

When current time is within 5 seconds of a leap second, don't accumulate
new samples or update the leap second status to increase the chances of
getting through safely.

10 years agontp: print warning 10 years before supported time ends
Miroslav Lichvar [Tue, 9 Sep 2014 12:02:00 +0000 (14:02 +0200)] 
ntp: print warning 10 years before supported time ends

10 years agoconfigure: check if pkg-config is available
Miroslav Lichvar [Tue, 9 Sep 2014 10:23:14 +0000 (12:23 +0200)] 
configure: check if pkg-config is available

This is needed with some shells to prevent "pkg-config: not found"
errors from being displayed.

10 years agoFix compiler warnings on NetBSD
Miroslav Lichvar [Tue, 9 Sep 2014 09:48:09 +0000 (11:48 +0200)] 
Fix compiler warnings on NetBSD