Commit graph

1364 commits

Author SHA1 Message Date
Miroslav Lichvar
b703bc32c9 doc: update NEWS 2016-06-07 11:20:59 +02:00
Miroslav Lichvar
09afdd4b36 doc: update README 2016-06-07 11:20:59 +02:00
Miroslav Lichvar
5cadaf8d55 doc: add question about reference ID to FAQ 2016-06-07 11:20:59 +02:00
Stephen Wadeley
89ac745184 doc: improve chronyc man page
- fix redundant words, word order, articles, consistency, typos
- avoid slashes, contractions, `may`, dashes in running text
- add Oxford commas
- use colon before examples
2016-06-07 09:36:55 +02:00
Stephen Wadeley
e2422023c4 doc: improve chrony.conf man page
- fix word order, articles, consistency, and some typos
- avoid slashes, contractions, `may`, dashes in running text
- use colons before example and code blocks
- add Oxford commas
2016-06-07 09:36:55 +02:00
Miroslav Lichvar
1ec0813663 client: fix compiler warnings on NetBSD 2016-06-07 09:36:55 +02:00
Miroslav Lichvar
6ba7fad2a7 reference: suppress orphan option in special reference modes
This allows a server that will become the orphan source to initialize
its time with the initstepslew directive from the current orphan source
or its clients.
2016-05-30 14:12:42 +02:00
Miroslav Lichvar
962ca91574 doc: improve answer in FAQ for firewall issue 2016-05-23 09:01:10 +02:00
Miroslav Lichvar
91cbebb629 examples: update chrony.spec 2016-05-17 17:57:33 +02:00
Miroslav Lichvar
722f038f1f test: extend 105-ntpauth 2016-05-17 13:03:53 +02:00
Miroslav Lichvar
5e61c002a6 ntp: fix definition of minimum and maximum MAC length
The NTP_*_MAC_LENGTH macros didn't include the key ID, which caused the
NTP authentication check to ignore MACs with 512-bit hashes (SHA512,
WHIRLPOOL).

This was broken since update to NTPv4.
2016-05-17 12:57:28 +02:00
Miroslav Lichvar
46e1e79921 doc: update NEWS 2016-05-16 11:08:00 +02:00
Miroslav Lichvar
546e5e236c make_release: update for changes in documentation 2016-05-13 16:58:07 +02:00
Miroslav Lichvar
16a1a89bf4 makefile: remove config.h and config.log in distclean 2016-05-13 16:58:07 +02:00
Miroslav Lichvar
8a996572d2 update copyright years 2016-05-13 16:58:07 +02:00
Miroslav Lichvar
5f082b9a4d doc: update examples of configuration in isolated networks 2016-05-13 16:58:07 +02:00
Miroslav Lichvar
4622173135 doc: fix typo in chronyc man page 2016-05-13 16:58:07 +02:00
Miroslav Lichvar
99e1c44c25 doc: update FAQ 2016-05-13 16:58:04 +02:00
Miroslav Lichvar
b48e4421de ntp: don't check for synchronization loop in special reference modes
If a special reference mode is enabled, always pass the test for
synchronization loop. This allows chronyd using the initstepslew
directive (or the -q/-Q option) to accept time from its own clients
after restart as is documented in the chrony.conf man page.

This was broken since update to NTPv4.
2016-05-13 13:47:12 +02:00
Miroslav Lichvar
d1f4e5876b refclock: avoid reallocation of refclock instances
Change the array with refclock instances to store just pointers and
avoid reallocation of the instances. This fixes a bug with the SOCK
refclock, which uses the pointer to the instance in a file handler and
which was invalid when the instance was reallocated (after adding
another refclock).

The bug is from commit d92583ed33.
2016-05-12 13:27:46 +02:00
Miroslav Lichvar
71b7e689c0 sched: fix handling of signals after finalization
Don't require the scheduler to be initialized in SCH_QuitProgram().
This fixes a crash when a signal is received between scheduler
finalization and chronyd exit.
2016-04-15 14:49:03 +02:00
Miroslav Lichvar
26b87b844d sources: consider only reachable orphans for selection
Ignore orphan sources that are unreachable (but still have usable stats)
to have a quick and consistent source selection between orphans.

This also fixes the "Unknown local refid in orphan mode" error appearing
when a selected orphan source is removed, as the source is marked as
unreachable and the selection runs with disabled NTP instance before the
source instance is actually removed.
2016-04-13 11:43:36 +02:00
Miroslav Lichvar
1834ee05e5 doc: fix typos in man pages 2016-04-12 12:43:10 +02:00
Miroslav Lichvar
7d7bf915ac doc: improve answer in FAQ for error 501 Not authorised 2016-04-12 12:43:10 +02:00
Miroslav Lichvar
d86e9f4aa3 doc: use https in links to chrony website 2016-04-12 12:24:41 +02:00
Miroslav Lichvar
942b52a3ca client: initialize variables in new local command 2016-04-11 08:28:45 +02:00
Miroslav Lichvar
b252c57a22 reference: rework activation of local reference
Instead of using a timer for switching the reference to the
unsynchronised state (which activates the local reference), check
if it should be active when returning the reference parameters.
2016-04-08 16:47:41 +02:00
Miroslav Lichvar
2aab6a85a4 reference: return real sync status in REF_GetReferenceParams()
If local reference is active, return normal leap, but unsynchronised
status. Update the callers of the function to work with the leap
directly and not change their behaviour.

REF_IsLocalActive() is no longer needed.
2016-04-08 16:29:09 +02:00
Miroslav Lichvar
10719d6d35 reference: report same values in tracking command as in NTP
Use REF_GetReferenceParams() in the tracking command to simplify the
code and report the same values as what NTP clients of the server see.

When the local reference mode is active, this changes the leap status to
synchronised and reference time to one second behind current time. When
not synchronised, the root delay and root dispersion are now 1 second.
2016-04-08 16:21:19 +02:00
Miroslav Lichvar
59938efd23 stubs: add NSR_GetLocalRefid() 2016-04-08 16:21:19 +02:00
Miroslav Lichvar
53b15bd5c7 cmdmon: extend local command to match local directive 2016-04-08 16:21:19 +02:00
Miroslav Lichvar
5084a8b342 reference: clamp local stratum set from cmdmon 2016-04-08 16:21:15 +02:00
Miroslav Lichvar
4d1c795804 cmdparse: check if stratum in local directive is valid 2016-04-06 16:38:14 +02:00
Miroslav Lichvar
a9049569af cmdmon: remove obsolete definition 2016-04-06 15:56:12 +02:00
Miroslav Lichvar
dec1d2bfb2 ntp: ignore order of resolved addresses when replacing tentative source
If the replaced source never had a valid reply (e.g. because it was a
bad replacement), ignore the order of addresses from the resolver to not
get stuck to a pair of addresses if the order doesn't change, or a group
of IPv4/IPv6 addresses if the resolver prefers inaccessible IP family.
2016-04-05 18:03:46 +02:00
Miroslav Lichvar
62e66bda60 ntp: mark all new sources and replacements as tentative 2016-04-05 18:03:44 +02:00
Miroslav Lichvar
3abaa92926 doc: update description of local directive 2016-04-01 18:42:43 +02:00
Miroslav Lichvar
37e6357c02 ntp: don't check reference timestamp in received packets
When ntpd as an NTP server has active orphan mode, it doesn't update
its reference time and the reference timestamp may fail the NTP test
3 and 7. (https://bugs.ntp.org/show_bug.cgi?id=1098)

Remove both checks of the timestamp to allow chronyd to operate as
a client of ntpd server in the orphan mode. When ntpd is fixed and
old versions are no longer used, this may be reverted.
2016-04-01 15:13:28 +02:00
Miroslav Lichvar
6accd19eb3 sources: log error when local refid is unknown in orphan mode 2016-04-01 09:37:49 +02:00
Miroslav Lichvar
da96d334ab test: add 121-orphan 2016-03-31 16:12:14 +02:00
Miroslav Lichvar
5a92dbe784 sources: add support for orphan sources
When the local reference is configured with the orphan option, NTP
sources that have stratum equal to the configured local stratum are
considered to be orphans (i.e. serving local time while not being
synchronised with real time) and are excluded from the normal source
selection. Sources with stratum larger than the local stratum are
considered to be directly on indirectly synchronised to an orphan and
are always ignored.

If no selectable source is available and all orphan sources have
reference IDs larger than the local ID, no source will be selected and
the local reference mode will be activated at some point, i.e. this host
will become an orphan. Otherwise, the orphan source with the smallest
reference ID will be selected. This ensures a group of servers polling
each other (with the same orphan configuration) which have no external
source can settle down to a state where only one server is serving its
local unsychronised time and others are synchronised to it.
2016-03-31 16:08:49 +02:00
Miroslav Lichvar
8fe5e9cf1e reference: add orphan mode to local reference
Add orphan option to the local directive. It will enable an orphan mode
compatible with ntpd.
2016-03-31 16:08:49 +02:00
Miroslav Lichvar
81f440a882 reference: activate local reference with large root distance
Since the update to NTPv4, when the clock is in the synchronised state
and the clock updates stop (e.g. sources become unreachable), it doesn't
switch to the unsynchronised state and the local reference is never
activate. This can be a problem for clients that rely on the server to
always have root distance below some value (e.g. chronyd's maxdistance).

Add a timer that will activate the local reference when the root
distance reaches a specified threshold. It can be configured with the
distance option in the local directive (by default 1.0 second).
2016-03-31 16:08:45 +02:00
Miroslav Lichvar
981f897c96 conf: rework local directive to have default stratum
Allow the local directive to be specified without the stratum field.
It's an option now, with default value 10. Also, move the parsing code
to cmdparse.c to make it available to the client.
2016-03-31 16:01:06 +02:00
Miroslav Lichvar
eb75ce7d07 ntp: add function to get local reference ID
When a valid NTP reply is received, save the local address (e.g. from
IP_PKTINFO), so the reference ID which would the source use for this
host can be calculated when needed.
2016-03-31 16:01:02 +02:00
Miroslav Lichvar
5645e57ce0 sys_linux: include <termios.h> for TCGETS 2016-03-29 10:06:21 +02:00
Miroslav Lichvar
a12c7c422b local: make maximum frequency offset configurable
Add maxdrift directive to set the maximum assumed drift of the clock,
which sets the maximum frequency offset chronyd is allowed to use to
to correct the drift.
2016-03-22 17:12:27 +01:00
Miroslav Lichvar
d70e815e9f sources: try to replace NTP sources with bad distance
Similarly to unreachable sources and falsetickers, try to replace
sources with distance larger than the limit set by the maxdistance
directive with a newly resolved address of the hostname.
2016-03-22 17:12:27 +01:00
Miroslav Lichvar
eb329e9f52 client: ignore -v option in csv mode 2016-03-22 16:34:35 +01:00
Miroslav Lichvar
5833be6ccf util: fix UTI_FloatNetworkToHost() with very small exponents
Fix conversion of floating point numbers from the cmdmon format with
very small exponents, as for instance could be in the smoothing report
when the smoothing process ends.

This was broken in commit 8e71a46173.
2016-03-17 16:18:28 +01:00