Commit graph

980 commits

Author SHA1 Message Date
Miroslav Lichvar
9ef723eb97 test: add option to create falsetickers 2014-10-20 12:26:29 +02:00
Miroslav Lichvar
7958b1764e ntp: remove debug messages in slew handler 2014-10-20 12:22:17 +02:00
Miroslav Lichvar
44f612acbc sourcestats: reduce debug messages in slew handler 2014-10-20 12:22:16 +02:00
Miroslav Lichvar
5d7df69116 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.
2014-10-20 12:19:36 +02:00
Miroslav Lichvar
8f06245428 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.
2014-10-20 12:19:36 +02:00
Miroslav Lichvar
0f8368bcf1 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.
2014-10-20 11:23:48 +02:00
Miroslav Lichvar
5d0356a75e sources: fix reported normal select option 2014-10-20 11:19:45 +02:00
Miroslav Lichvar
5f68941241 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.
2014-10-20 11:19:28 +02:00
Miroslav Lichvar
63af4889f6 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.
2014-10-20 11:02:07 +02:00
Miroslav Lichvar
6f84d2fac1 sources: reorder SRC_SelectSource()
Reorder the code to improve readability and also update coding style.
No functional changes.
2014-10-20 11:02:07 +02:00
Miroslav Lichvar
049eae661a 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.
2014-10-20 11:02:07 +02:00
Miroslav Lichvar
e930d94728 sources: update reference only with new sample
This follows the section 11.2.3. from RFC 5905.
2014-10-20 11:02:07 +02:00
Miroslav Lichvar
819b8eb73d ntp: fix Clang warning 2014-10-15 12:40:12 +02:00
Miroslav Lichvar
a78bf0c34e ntp: merge broadcast code with ntp_core 2014-10-15 12:27:46 +02:00
Miroslav Lichvar
e0059bcc6b ntp: define NTP_MAX_STRATUM for other modules 2014-10-14 17:25:55 +02:00
Miroslav Lichvar
af0b83a2c3 doc: update for NTPv4 support 2014-10-14 16:57:01 +02:00
Miroslav Lichvar
2c033989b6 Update comments referencing RFC 1305 2014-10-14 16:52:22 +02:00
Miroslav Lichvar
8fbfe55e92 ntp: update packet processing to NTPv4 (RFC 5905) 2014-10-14 16:52:22 +02:00
Miroslav Lichvar
740e8130dd ntp: clamp value set by minstratum option 2014-10-13 15:10:15 +02:00
Miroslav Lichvar
5bddaf6820 sources: use correct specifier for refid in debug message 2014-10-13 15:10:15 +02:00
Miroslav Lichvar
c36230e21b ntp: print number of bytes sent in debug message 2014-10-13 15:10:15 +02:00
Miroslav Lichvar
15d8c08eaa ntp: enable PKTINFO on client sockets
This will be useful to detect synchronization loops.
2014-10-08 15:13:02 +02:00
Miroslav Lichvar
2f738d5805 util: fix sockaddr function naming 2014-10-03 10:15:18 +02:00
Miroslav Lichvar
e05b687009 client: improve sources caption 2014-09-29 11:29:51 +02:00
Miroslav Lichvar
55a22656b8 util: use common functions to convert to/from sockaddr 2014-09-26 17:54:45 +02:00
Miroslav Lichvar
2db20adc3e client: print full date in manual list 2014-09-26 15:47:57 +02:00
Miroslav Lichvar
c7eeb57a32 ntp: fix NSR_TakeSourcesOffline()
This was broken when switching to dynamic allocation in commit 9e7193.
2014-09-26 15:27:08 +02:00
Miroslav Lichvar
361726b3ae keys: store IDs in uint32_t 2014-09-26 14:14:54 +02:00
Miroslav Lichvar
c404786b92 logging: remove warning on missing debug messages
The state of the DEBUG feature is now printed with chronyd version.
2014-09-25 11:12:23 +02:00
Miroslav Lichvar
2ff4eca7bf 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)
2014-09-25 10:58:57 +02:00
Miroslav Lichvar
1eca83ff22 cmdmon: allocate reply slots in smaller quantums 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
2575fa8f83 cmdmon: use char for permissions table 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
b7e86192ee refclock: include refid in some debug messages 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
078f0f511e util: optimize UTI_RefidToString() 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
4963b931d0 rtc: allocate samples dynamically 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
75fd327222 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.
2014-09-25 10:58:57 +02:00
Miroslav Lichvar
9e71932c2e ntp: allocate source records dynamically
This removes the limit on maximum number of added NTP sources.
2014-09-25 10:58:57 +02:00
Miroslav Lichvar
d92583ed33 refclocks: allocate refclock instances dynamically 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
cd27860e55 keys: allocate keys dynamically
This removes the limit on maximum number of keys in the key file.
2014-09-25 10:58:57 +02:00
Miroslav Lichvar
ba875fc04a sched: allocate file handlers dynamically 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
b5a85bd2fe sources: reallocate arrays in exponentially increasing sizes 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
4e0df8c2a6 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.
2014-09-25 10:58:57 +02:00
Miroslav Lichvar
37bc30c8d9 Add array utility functions 2014-09-25 10:58:57 +02:00
Miroslav Lichvar
f6ed7844e1 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.
2014-09-25 10:57:55 +02:00
Miroslav Lichvar
d466390233 cmdparse: don't duplicate hostname in CPS_ParseNTPSourceAdd()
Let the caller duplicate the string if needed.
2014-09-24 12:43:11 +02:00
Miroslav Lichvar
336473398a Check for memory allocation errors 2014-09-23 15:47:02 +02:00
Miroslav Lichvar
bb16c81e7b test: make 114-presend more tolerant 2014-09-23 15:46:27 +02:00
Miroslav Lichvar
f955b46c13 nameserv: move fallback DNS_Name2IPAddressAsync() to stubs.c 2014-09-22 13:14:16 +02:00
Miroslav Lichvar
b54711252b configure: add --disable-sechash option 2014-09-22 13:14:16 +02:00
Miroslav Lichvar
f2710d5b55 Print enabled/disabled features with version 2014-09-22 13:14:16 +02:00