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

11 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.

11 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

11 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.

11 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

11 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.

11 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

11 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.

11 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

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

11 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.

11 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

11 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

11 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

11 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

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

11 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

11 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

11 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

11 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.

11 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.

11 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.

11 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

11 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.

11 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.

11 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.

11 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.

11 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.

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

11 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

11 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

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

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

11 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)

11 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

11 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

11 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

11 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.

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

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

11 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

11 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

11 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.

11 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

11 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.

11 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)

11 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

11 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

11 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

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

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

11 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.

11 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.

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

11 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.

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

11 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

11 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.

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

11 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.

11 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.

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

11 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

11 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

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

11 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

11 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

11 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

11 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

11 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

11 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.

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

11 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

11 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

11 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

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

11 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

11 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.

11 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

11 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.

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

11 years agoexamples: add NetworkManager dispatcher script
Miroslav Lichvar [Thu, 4 Sep 2014 15:43:27 +0000 (17:43 +0200)] 
examples: add NetworkManager dispatcher script

11 years agoexamples: add systemd services
Miroslav Lichvar [Thu, 4 Sep 2014 15:30:36 +0000 (17:30 +0200)] 
examples: add systemd services

11 years agoexamples: add logrotate configuration
Miroslav Lichvar [Thu, 4 Sep 2014 15:27:43 +0000 (17:27 +0200)] 
examples: add logrotate configuration

11 years agoMove chrony.spec to examples
Miroslav Lichvar [Thu, 4 Sep 2014 15:22:09 +0000 (17:22 +0200)] 
Move chrony.spec to examples

11 years agosys: fix typo in prctl() error message
Miroslav Lichvar [Mon, 25 Aug 2014 15:24:58 +0000 (17:24 +0200)] 
sys: fix typo in prctl() error message

11 years agoutil: fix compiler warning with 32-bit time_t
Miroslav Lichvar [Thu, 21 Aug 2014 12:06:06 +0000 (14:06 +0200)] 
util: fix compiler warning with 32-bit time_t

11 years agoUpdate NEWS 1.31-pre1
Miroslav Lichvar [Thu, 21 Aug 2014 07:56:57 +0000 (09:56 +0200)] 
Update NEWS

11 years agontp: don't stop online burst when sending fails
Miroslav Lichvar [Wed, 20 Aug 2014 14:41:18 +0000 (16:41 +0200)] 
ntp: don't stop online burst when sending fails

Don't stop online burst for unreachable sources until sending succeeds.
This is mainly useful with iburst when chronyd is started before the
network is configured.

11 years agontp: don't adjust polling interval when sending fails
Miroslav Lichvar [Wed, 20 Aug 2014 13:24:21 +0000 (15:24 +0200)] 
ntp: don't adjust polling interval when sending fails

11 years agontp: return with status from functions sending packets
Miroslav Lichvar [Wed, 20 Aug 2014 12:30:42 +0000 (14:30 +0200)] 
ntp: return with status from functions sending packets

11 years agodoc: clarify description of -s option
Miroslav Lichvar [Wed, 20 Aug 2014 10:52:55 +0000 (12:52 +0200)] 
doc: clarify description of -s option