1
0
Fork 0
mirror of https://gitlab.com/chrony/chrony.git synced 2026-12-03 00:14:38 +00:00
Advanced NTP client and server
  • C 90.4%
  • Shell 7.9%
  • Yacc 1.4%
  • Makefile 0.3%
Find a file
Wojtek Wasko 372462ca6c ntp: fix monotonic correction of transmit timestamp from peer
In the interleaved mode, the remote transmit timestamp of the previous
packet is corrected for the time corrections the source accumulated
since it was captured, as reported in the F323 field. That is right for
servers, which keep their transmit timestamps in the client log, but a
peer in the symmetric active mode slews its saved transmit timestamp
together with its clock. The correction was applied twice, making the
measured delay wrong by the correction and the offset by half of it.

Such a sample is usually rejected by the delay tests, but not if the
correction is comparable to the network delay.

Don't correct the transmit timestamp of packets from active peers.
Extend the 144-monoroot test to check the delay measured by a peer when
the other peer corrects its clock.

Fixes: 2319f72b29 ("ntp: add client support for experimental extension field")
2026-11-19 13:07:28 +01:00
contrib contrib: replace tuxfamily with chrony-project 2023-08-01 12:11:27 +02:00
doc configure: change default chronyc user to follow chronyd user 2026-11-19 12:00:31 +01:00
examples example: update example config files 2026-11-05 11:21:50 +01:00
test ntp: fix monotonic correction of transmit timestamp from peer 2026-11-19 13:07:28 +01:00
.gitignore git: update .gitignore 2018-09-12 17:16:33 +02:00
addressing.h addressing: introduce identifiers for unresolved addresses 2020-02-19 11:37:15 +01:00
addrfilt.c addrfilt: explicitly handle unexpected addresses 2020-02-18 16:01:25 +01:00
addrfilt.h ntp: open server socket only when access is allowed 2015-01-06 16:35:12 +01:00
array.c array: add function for removing elements 2023-03-02 10:41:28 +01:00
array.h array: add function for removing elements 2023-03-02 10:41:28 +01:00
candm.h smooth: drop leap second support 2026-11-05 11:19:40 +01:00
client.c client: fix mitigation for unsafe socket permission change 2026-11-19 11:38:08 +01:00
clientlog.c clientlog: reduce number of records per slot 2026-06-08 16:39:31 +02:00
clientlog.h clientlog: add support for KoD rate limiting 2024-04-02 15:23:26 +02:00
cmac.h cmac+hash: change parameter types 2020-07-09 14:47:33 +02:00
cmac_gnutls.c cmac: add gnutls support 2021-09-02 16:10:09 +02:00
cmac_nettle.c cmac+hash: add support for Nettle 4.0 2026-03-02 11:59:46 +01:00
cmdmon.c smooth: drop leap second support 2026-11-05 11:19:40 +01:00
cmdmon.h socket: enable only specified IP families 2020-06-17 15:24:55 +02:00
cmdparse.c ntp: add option to configure maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
cmdparse.h cmdparse: add status for server and local command 2025-03-20 15:57:55 +01:00
conf.c smooth: drop leap second support 2026-11-05 11:19:40 +01:00
conf.h smooth: drop leap second support 2026-11-05 11:19:40 +01:00
configure configure: print default chronyd and chronyc users 2026-11-19 12:00:31 +01:00
COPYING Update COPYING and FSF address 2009-10-28 17:53:33 +01:00
getdate.h Update COPYING and FSF address 2009-10-28 17:53:33 +01:00
getdate.y getdate+nts+rtc: avoid some coverity false positives 2025-05-21 12:41:13 +02:00
hash.h hash: allow non-security MD5 use in FIPS mode 2021-09-02 15:17:08 +02:00
hash_gnutls.c hash: allow non-security MD5 use in FIPS mode 2021-09-02 15:17:08 +02:00
hash_intmd5.c hash: allow non-security MD5 use in FIPS mode 2021-09-02 15:17:08 +02:00
hash_nettle.c cmac+hash: add support for Nettle 4.0 2026-03-02 11:59:46 +01:00
hash_nss.c hash: allow non-security MD5 use in FIPS mode 2021-09-02 15:17:08 +02:00
hash_tomcrypt.c hash: allow non-security MD5 use in FIPS mode 2021-09-02 15:17:08 +02:00
hwclock.c hwclock: don't drop valid samples in HCL_ProcessReadings() 2025-08-14 14:24:54 +02:00
hwclock.h hwclock: don't drop valid samples in HCL_ProcessReadings() 2025-08-14 14:24:54 +02:00
keys.c keys: remove misleading memset() 2025-07-02 16:02:31 +02:00
keys.h cmac+hash: change parameter types 2020-07-09 14:47:33 +02:00
local.c local: drop leap second support 2026-11-05 11:19:40 +01:00
local.h local: drop leap second support 2026-11-05 11:19:40 +01:00
localp.h local: drop leap second support 2026-11-05 11:19:40 +01:00
logging.c logging: warn if missing debug messages 2026-07-23 16:07:06 +02:00
logging.h logging: add macro to log message once 2026-07-23 16:07:08 +02:00
main.c leapdb: drop leap second support 2026-11-05 11:02:11 +01:00
main.h Remove CVS headers 2011-01-28 12:56:09 +01:00
make_release examples: drop chrony.spec 2018-09-12 11:38:10 +02:00
Makefile.in leapdb: drop leap second support 2026-11-05 11:02:11 +01:00
manual.c local: don't remove handlers in finalization 2020-05-21 12:42:18 +02:00
manual.h cmdmon: report offset after manual timestamp as float 2017-07-25 17:40:35 +02:00
md5.c md5: fix old-style function definitions 2023-04-17 11:40:18 +02:00
md5.h Cleanup including of system headers 2013-06-14 13:41:16 +02:00
memory.c memory: use free() instead of realloc() for size 0 2023-06-08 14:31:52 +02:00
memory.h memory: add missing include 2018-08-03 17:21:02 +02:00
nameserv.c nameserv: avoid sockaddr_in6 with disabled IPv6 support 2021-04-22 10:20:31 +02:00
nameserv.h nameserv: return at most 16 addresses from DNS_Name2IPAddress() 2016-01-13 11:25:26 +01:00
nameserv_async.c nameserv: allow concurrent asynchronous requests 2020-03-05 16:02:15 +01:00
nameserv_async.h stubs: don't call DNS_Name2IPAddress handler directly 2015-09-29 18:06:33 +02:00
NEWS doc: update NEWS 2026-08-27 14:38:15 +02:00
ntp.h ntp: update NTP-over-PTP support 2025-11-26 13:53:28 +01:00
ntp_auth.c nts: add parameter for maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
ntp_auth.h nts: add parameter for maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
ntp_core.c ntp: fix monotonic correction of transmit timestamp from peer 2026-11-19 13:07:28 +01:00
ntp_core.h ntp: limit warning about failed resolving to online sources 2026-08-12 13:17:47 +02:00
ntp_ext.c update copyright years 2020-09-16 12:09:52 +02:00
ntp_ext.h ntp: add functions for adding extension fields 2020-03-05 16:02:15 +01:00
ntp_io.c ntp: update NTP-over-PTP support 2025-11-26 13:53:28 +01:00
ntp_io.h ntp: save PTP correction from NTP-over-PTP messages 2023-09-26 15:14:13 +02:00
ntp_io_linux.c update copyright 2026-08-27 14:38:15 +02:00
ntp_io_linux.h ntp: add alternative method of retrieving transmitted messages 2025-11-18 15:55:36 +01:00
ntp_signd.c fix -Wshadow warnings 2025-11-20 10:22:45 +01:00
ntp_signd.h ntp: drop precompensation of TX timestamp 2020-07-09 14:46:57 +02:00
ntp_sources.c ntp: limit warning about failed resolving to online sources 2026-08-12 13:17:47 +02:00
ntp_sources.h cmdmon: refactor handling of sources report 2025-11-19 14:30:02 +01:00
nts_ke.h nts: add parameter for maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
nts_ke_client.c update copyright years 2024-10-08 12:11:32 +02:00
nts_ke_client.h nts: switch client to compliant key exporter on NTS NAK 2024-10-03 15:02:03 +02:00
nts_ke_server.c getdate+nts+rtc: avoid some coverity false positives 2025-05-21 12:41:13 +02:00
nts_ke_server.h nts: improve NTS-KE server/client code 2020-07-16 16:02:08 +02:00
nts_ke_session.c update copyright years 2025-08-14 15:30:27 +02:00
nts_ke_session.h nts: construct key exporter context 2024-09-26 12:45:44 +02:00
nts_ntp.h ntp: move initial packet parsing from ntp_auth to ntp_core 2021-11-16 10:00:31 +01:00
nts_ntp_auth.c rewrite some assertions for better readability 2025-03-06 15:22:36 +01:00
nts_ntp_auth.h nts: add support for NTP authenticator field using AES-GCM-SIV 2022-10-19 15:50:39 +02:00
nts_ntp_client.c nts: add parameter for maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
nts_ntp_client.h nts: add parameter for maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
nts_ntp_server.c rewrite some assertions for better readability 2025-03-06 15:22:36 +01:00
nts_ntp_server.h nts: add NTS-NTP server and client 2020-03-05 16:02:15 +01:00
pktlength.c cmdmon: set maxntsretry for new sources 2026-07-23 13:22:35 +02:00
pktlength.h cmdmon: make length of manual list constant 2018-03-06 13:47:25 +01:00
privops.c update copyright 2026-08-27 14:38:15 +02:00
privops.h privops: add method PRV_AdjustFreq() 2026-02-25 12:35:50 +01:00
ptp.h ntp: update NTP-over-PTP support 2025-11-26 13:53:28 +01:00
quantiles.c rewrite some assertions for better readability 2025-03-06 15:22:36 +01:00
quantiles.h quantiles: add parameter to limit negative step 2024-11-21 16:00:23 +01:00
README doc: update credits in README 2026-08-27 14:38:15 +02:00
refclock.c reference: drop leap second support 2026-11-05 11:19:33 +01:00
refclock.h refclock: add option to ignore driver initialization errors 2026-07-14 11:24:20 +02:00
refclock_phc.c refclock: don't abort in driver initializations 2026-07-14 11:10:05 +02:00
refclock_pps.c refclock: don't abort in driver initializations 2026-07-14 11:10:05 +02:00
refclock_rtc.c refclock: don't abort in driver initializations 2026-07-14 11:10:05 +02:00
refclock_sensor.c refclock: add SENSOR driver for OpenBSD timedelta sensors 2026-07-22 12:10:07 +02:00
refclock_shm.c refclock: don't abort in driver initializations 2026-07-14 11:10:05 +02:00
refclock_sock.c refclock: don't abort in driver initializations 2026-07-14 11:10:05 +02:00
reference.c reference: drop leap second support 2026-11-05 11:19:33 +01:00
reference.h reference: drop leap second support 2026-11-05 11:19:33 +01:00
regress.c avoid some static analysis errors 2024-04-11 10:31:02 +02:00
regress.h regress: provide function to find median 2017-06-27 15:29:01 +02:00
reports.h smooth: drop leap second support 2026-11-05 11:19:40 +01:00
rtc.c reference: make driftfile update interval configurable 2024-11-14 13:43:18 +01:00
rtc.h rtc: move preinit call to RTC_Initialise() 2014-08-19 10:46:32 +02:00
rtc_linux.c rtc: check for gmtime()/localtime() error when setting RTC 2026-01-26 12:33:12 +01:00
rtc_linux.h rtc: optionally return raw time from RTC_Linux_ReadTime* 2024-12-04 15:24:52 +01:00
samplefilt.c samplefilt: add debug message for selected samples 2022-07-21 14:17:22 +02:00
samplefilt.h samplefilt: add function to get maximum number of samples 2022-07-21 14:17:22 +02:00
sched.c sched: don't define FD_SETSIZE 2025-05-26 16:34:23 +02:00
sched.h ntp: add maximum PHC poll interval 2023-03-22 09:13:53 +01:00
siv.h nts: switch client to compliant key exporter on NTS NAK 2024-10-03 15:02:03 +02:00
siv_gnutls.c update copyright years 2023-12-05 14:22:10 +01:00
siv_nettle.c rewrite some assertions for better readability 2025-03-06 15:22:36 +01:00
smooth.c smooth: drop leap second support 2026-11-05 11:19:40 +01:00
smooth.h smooth: drop leap second support 2026-11-05 11:19:40 +01:00
socket.c socket: add flag to not remove Unix socket path 2026-11-10 09:36:06 +01:00
socket.h socket: add flag to not remove Unix socket path 2026-11-10 09:36:06 +01:00
sources.c reference: drop leap second support 2026-11-05 11:19:33 +01:00
sources.h sources: drop leap second support 2026-11-05 11:02:11 +01:00
sourcestats.c sourcestats: change MAX_SKEW to 1.0 2026-06-09 15:00:23 +02:00
sourcestats.h sourcestats: change ST_GetSelectionData() to return status directly 2025-11-04 14:47:35 +01:00
srcparams.h ntp: add option to configure maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
stubs.c nts: add parameter for maximum NTS-KE retry interval 2026-07-23 13:22:35 +02:00
sys.c sys: add OpenBSD support 2026-02-25 12:35:50 +01:00
sys.h privops: enable system call filter 2026-02-25 12:35:50 +01:00
sys_generic.c local: drop leap second support 2026-11-05 11:19:40 +01:00
sys_generic.h local: drop leap second support 2026-11-05 11:19:40 +01:00
sys_linux.c sys_linux: allow more PTP ioctls in seccomp filter 2026-11-19 12:08:00 +01:00
sys_linux.h refclock_phc: open device for writing with extpps option 2025-08-07 14:43:37 +02:00
sys_linux_scmp.c sys_linux: fix building with older compilers and some archs 2025-10-22 14:03:44 +02:00
sys_linux_scmp.h sys_linux: fix building with older compilers and some archs 2025-10-22 14:03:44 +02:00
sys_macosx.c local: drop leap second support 2026-11-05 11:19:40 +01:00
sys_macosx.h sys: specify process context for dropping root 2020-10-05 18:56:37 +02:00
sys_netbsd.c sys_netbsd: don't check access to /dev/clockctl with -x 2020-10-05 18:56:37 +02:00
sys_netbsd.h sys_netbsd: don't check access to /dev/clockctl with -x 2020-10-05 18:56:37 +02:00
sys_null.c local: drop leap second support 2026-11-05 11:19:40 +01:00
sys_null.h sys: add null driver 2017-03-10 16:51:03 +01:00
sys_openbsd.c local: drop leap second support 2026-11-05 11:19:40 +01:00
sys_openbsd.h sys: add OpenBSD support 2026-02-25 12:35:50 +01:00
sys_posix.c sys_posix: support SCHED_FIFO and mlockall on more OSs 2019-04-24 12:18:07 +02:00
sys_posix.h sys_posix: support SCHED_FIFO and mlockall on more OSs 2019-04-24 12:18:07 +02:00
sys_solaris.c doc: switch Solaris support to illumos 2021-12-09 17:03:56 +01:00
sys_solaris.h sys: specify process context for dropping root 2020-10-05 18:56:37 +02:00
sys_timex.c sys_timex: drop leap second support 2026-11-05 11:19:48 +01:00
sys_timex.h sys_timex: move inclusion of sys/timex.h to sysincl.h 2015-12-10 16:30:38 +01:00
sysincl.h util: require inet_pton() 2021-03-04 12:36:36 +01:00
tempcomp.c fix -Wshadow warnings 2025-11-20 10:22:45 +01:00
tempcomp.h Update copyright 2011-01-27 13:05:26 +01:00
tls.h tls: fix server log messages to have client IP address 2025-08-07 10:18:31 +02:00
tls_gnutls.c tls_gnutls: remove trailing dot for certificate verification 2026-06-08 16:26:13 +02:00
util.c util: add functions to check timespec and timeval normality 2026-06-30 09:19:34 +02:00
util.h leapdb: drop leap second support 2026-11-05 11:02:11 +01:00

This is the README for chrony.

What is chrony?
===============

chrony is a versatile implementation of the Network Time Protocol (NTP).
It can synchronise the system clock with NTP servers, reference clocks
(e.g. GPS receiver), and manual input using wristwatch and keyboard.
It can also operate as an NTPv4 (RFC 5905) server and peer to provide
a time service to other computers in the network.

It is designed to perform well in a wide range of conditions, including
intermittent network connections, heavily congested networks, changing
temperatures (ordinary computer clocks are sensitive to temperature),
and systems that do not run continuously, or run on a virtual machine.

Typical accuracy between two machines synchronised over the Internet is
within a few milliseconds; on a LAN, accuracy is typically in tens of
microseconds.  With hardware timestamping, or a hardware reference clock,
sub-microsecond accuracy may be possible.

Two programs are included in chrony, chronyd is a daemon that can be
started at boot time and chronyc is a command-line interface program
which can be used to monitor chronyd's performance and to change various
operating parameters whilst it is running.

What will chrony run on?
========================

The software is known to work on Linux, FreeBSD, NetBSD, OpenBSD, macOS,
and illumos.  Closely related systems may work too.  Any other system
will likely require a porting exercise.

How do I set it up?
===================

The file INSTALL gives instructions.  On supported systems the
compilation process should be automatic.  You will need a C compiler,
e.g. gcc or clang.

What documentation is there?
============================

The distribution includes manual pages and a document containing
Frequently Asked Questions (FAQ).

The documentation is also available on the chrony web pages, accessible
through the URL 

    https://chrony-project.org/

License
=======

chrony is distributed under the GNU General Public License version 2.

Authors
=======

Richard P. Curnow <rc@rc0.org.uk>
Miroslav Lichvar <mlichvar@redhat.com>

Acknowledgements
================

In writing the chronyd program, extensive use has been made of the NTPv3 (RFC
1305) and NTPv4 (RFC 5905) specification.  The source code of the xntpd/ntpd
implementation written by Dennis Fergusson, Lars Mathiesen, David Mills, and
others has been used to check the details of the protocol.

The following people have provided patches and other major contributions
to chrony:

Lonnie Abelbeck <lonnie@abelbeck.com>
Benny Lyne Amorsen <benny@amorsen.dk>
Andrew Bishop <amb@gedanken.demon.co.uk>
Vincent Blut <vincent.debian@free.fr>
Luca Boccassi <bluca@debian.org>
Stephan I. Boettcher <stephan@nevis1.columbia.edu>
David Bohman <debohman@gmail.com>
Anthony Brandon <anthony@amarulasolutions.com>
Goswin Brederlow <brederlo@informatik.uni-tuebingen.de>
Leigh Brown <leigh@solinno.co.uk>
Erik Bryer <ebryer@spots.ab.ca>
Jonathan Cameron <jic23@cam.ac.uk>
Bryan Christianson <bryan@whatroute.net>
Juliusz Chroboczek <jch@pps.jussieu.fr>
Paul Donald <newtwen+gitlab@gmail.com>
Dan Drown <dan-ntp@drown.org>
Kamil Dudka <kdudka@redhat.com>
Christian Ehrhardt <christian.ehrhardt@canonical.com>
Paul Elliott <pelliott@io.com>
Robert Fairley <rfairley@redhat.com>
Ahmad Fatoum <a.fatoum@pengutronix.de>
Andreas Fenkart <extern-afe@mission-embedded.com>
Stefan R. Filipek <srfilipek@gmail.com>
Andy Fiddaman <illumos@fiddaman.net>
Mike Fleetwood <mike@rockover.demon.co.uk>
Rob Gill <rrobgill@protonmail.com>
Alexander Gretencord <arutha@gmx.de>
Andrew Griffiths <agriffit@redhat.com>
Walter Haidinger <walter.haidinger@gmx.at>
Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
John Hasler <john@dhh.gt.org>
Tjalling Hattink <t.hattink@fugro.nl>
Liam Hatton <me@liamhatton.com>
Emery Hemingway <emery@informatics.coop>
Holger Hoffstätte <holger@applied-asynchrony.com>
Jachym Holecek <jakym@volny.cz>
Håkan Johansson <f96hajo@chalmers.se>
Antti Järvinen <costello@iki.fi>
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Jim Knoble <jmknoble@pobox.com>
Thomas Kupper <tom@kupper.org>
Eric Lammerts <eric@lammerts.org>
JR Lanteigne <root@dnim.dev>
Stefan Lucke <stefan@lucke.in-berlin.de>
Victor Lum <viclum@vanu.com>
Kevin Lyda <kevin@ie.suberic.net>
Paul Menzel <paulepanter@users.sourceforge.net>
Vladimir Michl <vladimir.michl@seznam.cz>
Victor Moroz <vim@prv.adlum.ru>
Kalle Olavi Niemitalo  <tosi@stekt.oulu.fi>
Patrick Oppenlander <patrick.oppenlander@gmail.com>
Frank Otto <sandwichmacher@web.de>
Denny Page <dennypage@me.com>
Rupesh Patel <rupatel@redhat.com>
Chris Perl <cperl@janestreet.com>
Gautier PHILIPPON <gautier.philippon@ensimag.grenoble-inp.fr>
Andreas Piesk <apiesk@virbus.de>
Shachar Raindel <shacharr@google.com>
Mike Ryan <msr@hsilop.net>
Baruch Siach <baruch@tkos.co.il>
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Foster Snowhill <forst@forstwoof.ru>
Ingmar Stein <ingmarstein@icloud.com>
Andreas Steinmetz <ast@domdv.de>
NAKAMURA Takumi <takumi@ps.sakura.ne.jp>
Sören Tempel <soeren@soeren-tempel.net>
Timo Teras <timo.teras@iki.fi>
Bill Unruh <unruh@physics.ubc.ca>
Luke Valenta <lvalenta@cloudflare.com>
Atanas Vladimirov <vladimirov.atanas@gmail.com>
Stephen Wadeley <swadeley@redhat.com>
Bernhard Weiss <lisnablagh@web.de>
Wolfgang Weisselberg <weissel@netcologne.de>
Bernhard M. Wiedemann <bwiedemann@suse.de>
Joachim Wiedorn <ad_debian@joonet.de>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>
Michael Witten <mfwitten@gmail.com>
Doug Woodward <dougw@whistler.com>
Thomas Zajic <zlatko@zlatko.fdns.net>

Many other people have contributed bug reports and suggestions.  We are sorry
we cannot identify all of you individually.