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

11 years agosched: improve time jump detection
Miroslav Lichvar [Wed, 20 Aug 2014 09:34:16 +0000 (11:34 +0200)] 
sched: improve time jump detection

To detect forward time jumps, use a timestamp made before calling
select() instead of the first timeout in the queue. Also, if the timeout
value is modified by select() (e.g. on Linux) use it to get a more
accurate estimate of the elapsed time.

11 years agontp: restart timer when poll interval changes on reset
Miroslav Lichvar [Tue, 19 Aug 2014 14:05:47 +0000 (16:05 +0200)] 
ntp: restart timer when poll interval changes on reset

11 years agontp: add function to restart transmit timer
Miroslav Lichvar [Tue, 19 Aug 2014 13:51:59 +0000 (15:51 +0200)] 
ntp: add function to restart transmit timer

11 years agosched: make sure scheduler parameter change handler is first
Miroslav Lichvar [Tue, 19 Aug 2014 09:45:30 +0000 (11:45 +0200)] 
sched: make sure scheduler parameter change handler is first

This is needed to allow other handlers to add new timers.

11 years agolocal: use common function to invoke parameter change handlers
Miroslav Lichvar [Tue, 19 Aug 2014 08:56:53 +0000 (10:56 +0200)] 
local: use common function to invoke parameter change handlers

This was missing in commit b69b648d.

11 years agoreference: always update driftfile on exit
Miroslav Lichvar [Mon, 18 Aug 2014 16:31:02 +0000 (18:31 +0200)] 
reference: always update driftfile on exit

This is useful with the new fallback function of the -s option to
restore the system time at which chronyd was previously stopped.

11 years agortc: set clock to mtime of driftfile when RTC preinit fails
Miroslav Lichvar [Mon, 18 Aug 2014 16:21:24 +0000 (18:21 +0200)] 
rtc: set clock to mtime of driftfile when RTC preinit fails

When the RTC preinit function fails, set the system clock to the time of
the last modification of the driftfile if it's in the future. This makes
the -s option somewhat useful on systems where RTC is not supported or
missing.

This is similar to the functionality implemented in the fake-hwclock
script.

11 years agortc: don't try to open rtcfile when not set
Miroslav Lichvar [Mon, 18 Aug 2014 15:34:25 +0000 (17:34 +0200)] 
rtc: don't try to open rtcfile when not set

11 years agortc: use fscanf() to read coefficients
Miroslav Lichvar [Mon, 18 Aug 2014 15:19:36 +0000 (17:19 +0200)] 
rtc: use fscanf() to read coefficients

11 years agortc: return status from preinit function
Miroslav Lichvar [Mon, 18 Aug 2014 15:03:55 +0000 (17:03 +0200)] 
rtc: return status from preinit function

11 years agortc: use LCL functions to read and step system clock
Miroslav Lichvar [Mon, 18 Aug 2014 11:07:52 +0000 (13:07 +0200)] 
rtc: use LCL functions to read and step system clock

11 years agortc: improve accuracy of preinit step
Miroslav Lichvar [Mon, 18 Aug 2014 11:06:38 +0000 (13:06 +0200)] 
rtc: improve accuracy of preinit step

11 years agortc: minor cleanup in RTC_Linux_TimePreInit()
Miroslav Lichvar [Mon, 18 Aug 2014 09:58:56 +0000 (11:58 +0200)] 
rtc: minor cleanup in RTC_Linux_TimePreInit()

11 years agortc: move preinit call to RTC_Initialise()
Miroslav Lichvar [Mon, 18 Aug 2014 09:25:16 +0000 (11:25 +0200)] 
rtc: move preinit call to RTC_Initialise()

11 years agortc: cleanup in error messages
Miroslav Lichvar [Mon, 18 Aug 2014 09:03:15 +0000 (11:03 +0200)] 
rtc: cleanup in error messages

11 years agotest: add 115-cmdmontime
Miroslav Lichvar [Mon, 18 Aug 2014 13:09:48 +0000 (15:09 +0200)] 
test: add 115-cmdmontime

11 years agoutil: update functions converting cmdmon timestamps
Miroslav Lichvar [Mon, 18 Aug 2014 12:52:07 +0000 (14:52 +0200)] 
util: update functions converting cmdmon timestamps

11 years agocmdmon: convert LOGON timestamp only with LOGON message
Miroslav Lichvar [Mon, 18 Aug 2014 11:58:52 +0000 (13:58 +0200)] 
cmdmon: convert LOGON timestamp only with LOGON message

Avoid always calling UTI_TimevalNetworkToHost() and make the code more
readable.

11 years agosched: check that added file descriptor fits in fd_set
Miroslav Lichvar [Fri, 15 Aug 2014 14:36:00 +0000 (16:36 +0200)] 
sched: check that added file descriptor fits in fd_set

11 years agosched: use FD_SETSIZE if defined
Miroslav Lichvar [Fri, 15 Aug 2014 14:32:26 +0000 (16:32 +0200)] 
sched: use FD_SETSIZE if defined

11 years agotest: add 114-presend
Miroslav Lichvar [Fri, 15 Aug 2014 14:23:09 +0000 (16:23 +0200)] 
test: add 114-presend

11 years agontp: add debug message for received packet
Miroslav Lichvar [Fri, 15 Aug 2014 14:17:50 +0000 (16:17 +0200)] 
ntp: add debug message for received packet

11 years agontp: use NTP instead of echo for presend
Miroslav Lichvar [Fri, 15 Aug 2014 13:45:48 +0000 (15:45 +0200)] 
ntp: use NTP instead of echo for presend

Switch to NTP for presend as the echo service (RFC 862) is rarely
enabled. When presend is active, send an NTP client packet to the
server/peer and ignore the reply.

This also fixes presend with separate client sockets. The destination
port can't be changed on connected sockets, so the echo packet was sent
to the NTP port instead of the echo port.

11 years agoCheck for truncated source address when receiving packets
Miroslav Lichvar [Fri, 15 Aug 2014 10:54:32 +0000 (12:54 +0200)] 
Check for truncated source address when receiving packets

11 years agotest: fix check in run script
Miroslav Lichvar [Fri, 15 Aug 2014 08:12:36 +0000 (10:12 +0200)] 
test: fix check in run script

11 years agotest: add 008-ntpera
Miroslav Lichvar [Thu, 14 Aug 2014 16:02:28 +0000 (18:02 +0200)] 
test: add 008-ntpera

11 years agotest: allow tests to be skipped
Miroslav Lichvar [Thu, 14 Aug 2014 15:58:59 +0000 (17:58 +0200)] 
test: allow tests to be skipped

11 years agoutil: add support for other NTP eras
Miroslav Lichvar [Thu, 7 Aug 2014 15:08:19 +0000 (17:08 +0200)] 
util: add support for other NTP eras

NTP timestamps use only 32 bits to count seconds and the current NTP era
ends in 2036. Add support for converting NTP timestamps from other NTP
eras on systems with 64-bit time_t.

The earliest assumed NTP time is set by the configure script (by default
to 50 years before the date of the build) and earlier NTP timestamps
underflow to the following NTP era.

11 years agontp: move packet size asserts to ntp_core
Miroslav Lichvar [Thu, 7 Aug 2014 12:29:15 +0000 (14:29 +0200)] 
ntp: move packet size asserts to ntp_core

11 years agoutil: fix printing of timestamps when time_t is longer than long
Miroslav Lichvar [Thu, 7 Aug 2014 12:23:33 +0000 (14:23 +0200)] 
util: fix printing of timestamps when time_t is longer than long

11 years agoconfigure: check for 64-bit time_t
Miroslav Lichvar [Thu, 7 Aug 2014 12:11:17 +0000 (14:11 +0200)] 
configure: check for 64-bit time_t