]> git.ipfire.org Git - thirdparty/chrony.git/log
thirdparty/chrony.git
11 years agolocal: refactor invocation of parameter change handlers
Miroslav Lichvar [Fri, 30 May 2014 12:46:46 +0000 (14:46 +0200)] 
local: refactor invocation of parameter change handlers

11 years agontp: reset NCR instance thoroughly when switching to offline
Miroslav Lichvar [Fri, 30 May 2014 15:04:10 +0000 (17:04 +0200)] 
ntp: reset NCR instance thoroughly when switching to offline

11 years agosourcestats: reset SST instance thoroughly when dropping samples
Miroslav Lichvar [Mon, 2 Jun 2014 14:30:12 +0000 (16:30 +0200)] 
sourcestats: reset SST instance thoroughly when dropping samples

11 years agosourcestats: remove forgotten declaration
Miroslav Lichvar [Thu, 29 May 2014 16:43:11 +0000 (18:43 +0200)] 
sourcestats: remove forgotten declaration

11 years agoconfigure: fix test code to be compilable with -Werror
Miroslav Lichvar [Fri, 30 May 2014 14:12:02 +0000 (16:12 +0200)] 
configure: fix test code to be compilable with -Werror

11 years agortc: more reliable method of reading rtc for initial trim
Hattink, Tjalling [FINT] [Wed, 28 May 2014 11:54:27 +0000 (13:54 +0200)] 
rtc: more reliable method of reading rtc for initial trim

When chrony reads in the linux rtc for the first time to trim the system
clock, it only reads it once. As it is possible that the rtc updates
itself during the read operation, the reported rtc time could be false.
To prevent this I've added a loop that reads the rtc clock twice, if the
seconds do not match retry the two read operations. If they match you
can assume the read operation was successful.

This is based on the hwclock implementation of reading the rtc clock
from the util-linux package.

11 years agorefclock: don't include average dispersion in unfiltered samples
Miroslav Lichvar [Fri, 23 May 2014 13:22:11 +0000 (15:22 +0200)] 
refclock: don't include average dispersion in unfiltered samples

The dispersion of refclock samples before filtering now includes only
offset correction error and precision.

This should fix a problem where locked PPS got stuck with large average
dispersion and didn't accept new samples due failing check of offset
and dispersion.

11 years agorefclock: add maxdispersion option
Miroslav Lichvar [Wed, 21 May 2014 12:27:50 +0000 (14:27 +0200)] 
refclock: add maxdispersion option

This can be used to prevent accumulation of samples with estimated
dispersion above given limit. By default, this limit is disabled.

11 years agosys: drop frequency scaling in Linux driver
Miroslav Lichvar [Thu, 22 May 2014 14:28:20 +0000 (16:28 +0200)] 
sys: drop frequency scaling in Linux driver

Since the kernel USER_HZ constant was introduced and the internal HZ
can't be reliably detected in user-space, the frequency scaling constant
used with older kernels is just a random guess.

Remove the scaling completely and let the closed loop compensate for the
error. To prevent thrashing between two states when the system's
frequency error is close to a multiple of USER_HZ, stick to the current
tick value if it's next to the new required tick. This is used only on
archs where USER_HZ is 100 as the frequency adjustment is limited to 500
ppm.

The linux_hz and linux_freq_scale directives are no longer supported,
but allowed by the config parser.

11 years agosys: set tick_update_hz to 100 by default in Linux driver
Miroslav Lichvar [Thu, 22 May 2014 13:49:11 +0000 (15:49 +0200)] 
sys: set tick_update_hz to 100 by default in Linux driver

We can't reliably detect the internal kernel HZ, it may not even be
fixed (CONFIG_NO_HZ). Use a fixed value of 100.

11 years agosys: avoid notification of neglible dispersion on slew update
Miroslav Lichvar [Thu, 22 May 2014 13:34:36 +0000 (15:34 +0200)] 
sys: avoid notification of neglible dispersion on slew update

11 years agodoc: update description of refclock options
Miroslav Lichvar [Thu, 22 May 2014 13:22:24 +0000 (15:22 +0200)] 
doc: update description of refclock options

11 years agorefclock: fix sample validation with sub-second poll
Miroslav Lichvar [Thu, 22 May 2014 13:14:12 +0000 (15:14 +0200)] 
refclock: fix sample validation with sub-second poll

11 years agoreference: fix logging of initial unsynchronized tracking entry
Miroslav Lichvar [Thu, 22 May 2014 12:38:33 +0000 (14:38 +0200)] 
reference: fix logging of initial unsynchronized tracking entry

11 years agomain: initialize reference mode properly
Miroslav Lichvar [Thu, 22 May 2014 12:06:52 +0000 (14:06 +0200)] 
main: initialize reference mode properly

11 years agorefclock: honour leap second flag in the PPS refclock
Tjalling Hattink [Thu, 22 May 2014 09:25:00 +0000 (11:25 +0200)] 
refclock: honour leap second flag in the PPS refclock

This patch fixes leap second handling for the PPS refclock. Without the
patch the PPS refclock will always report LEAP_normal. But if a locked
refclock (the SHM clock in my case) does report a leap state it should
also be taken over by the PPS refclock, otherwise chrony will still use
LEAP_normal when the PPS clock is used as reference source.

The patch will copy the leap state from the refclock. In case the PPS
clock is not specifically locked to another refclock it will take over
the leap state from the local clock.

I've tested this patch by simulating a leap second through the samples
for the SHM clock, and with the patch you will see chrony properly jump
forward or backward on the leap second. Without the patch it will not do
this and the clock becomes desynchronized and no leap state is reported
upstream to other NTP clients.

Signed-off-by: Tjalling Hattink <t.hattink@fugro.nl>
11 years agosys: use maximum timeout for offsets below minimum correction
Miroslav Lichvar [Wed, 21 May 2014 15:36:51 +0000 (17:36 +0200)] 
sys: use maximum timeout for offsets below minimum correction

There is no need to try to correct offsets below the specified minimum
(1 nanosecond), let the clock drift away after crossing zero offset and
avoid unnecessary updates.

11 years agoconf: add option to set maximum slew rate
Miroslav Lichvar [Wed, 21 May 2014 14:23:30 +0000 (16:23 +0200)] 
conf: add option to set maximum slew rate

With the generic driver, the maxslewrate directive sets the maximum
frequency offset that the driver is allowed to use to slew the time. By
default, it's set to 83333.333 (1/12). This is identical to what Linux
fast slewing used to use.

11 years agoconf: change default corrtimeratio to 3.0
Miroslav Lichvar [Wed, 21 May 2014 10:08:10 +0000 (12:08 +0200)] 
conf: change default corrtimeratio to 3.0

This improves the overall frequency accuracy of the clock at a slight
cost in the time accuracy.

11 years agosys: add apply_step_offset function to generic driver
Miroslav Lichvar [Tue, 20 May 2014 15:05:05 +0000 (17:05 +0200)] 
sys: add apply_step_offset function to generic driver

Move the generic code away from the Linux driver and keep there only
stepping by adjtimex(ADJ_SETOFFSET).

11 years agotest: update for recent changes in Linux driver
Miroslav Lichvar [Wed, 14 May 2014 15:10:23 +0000 (17:10 +0200)] 
test: update for recent changes in Linux driver

11 years agosys: convert Linux driver to use generic offset functions
Miroslav Lichvar [Wed, 14 May 2014 15:08:00 +0000 (17:08 +0200)] 
sys: convert Linux driver to use generic offset functions

Strip all slewing code (adjtime(), freq locked nano PLL, fast tick
slewing) from the Linux driver and use the new generic frequency only
slewing instead. The advantages include stable clock control with very
short update intervals, good control of the slewing frequency, cheap
cooking of raw time stamps and unlimited frequency offset.

11 years agosys: introduce generic driver
Miroslav Lichvar [Wed, 14 May 2014 15:06:18 +0000 (17:06 +0200)] 
sys: introduce generic driver

This driver is intended to complete system-specific drivers that don't
have implemented all required driver functionality. Currently, it
implements offset functions working on top of system-specific frequency
functions. Offsets are corrected by changing frequency, similarly to
fast slewing implemented in the Linux driver.

11 years agotest: make 110-chronyc even more tolerant
Miroslav Lichvar [Thu, 15 May 2014 16:45:09 +0000 (18:45 +0200)] 
test: make 110-chronyc even more tolerant

11 years agodoc: update faq.txt
Miroslav Lichvar [Fri, 16 May 2014 11:28:40 +0000 (13:28 +0200)] 
doc: update faq.txt

11 years agoclient: don't override hostname with -4 or -6 after -h
Miroslav Lichvar [Fri, 16 May 2014 11:21:49 +0000 (13:21 +0200)] 
client: don't override hostname with -4 or -6 after -h

11 years agoclient: set default hostname to 127.0.0.1 instead of localhost
Miroslav Lichvar [Fri, 16 May 2014 11:05:32 +0000 (13:05 +0200)] 
client: set default hostname to 127.0.0.1 instead of localhost

This is to make sure chronyd will see the remote address as 127.0.0.1
and allow access even when localhost resolves to an address of a
non-loopback interface.

11 years agoclient: enable IP_RECVERR socket option
Miroslav Lichvar [Fri, 16 May 2014 08:33:01 +0000 (10:33 +0200)] 
client: enable IP_RECVERR socket option

This is useful to get ECONNREFUSED when the host replies with ICMP port
unreachable message and avoid having to wait for timeout.

11 years agosys: remove unused static variables in Linux driver
Miroslav Lichvar [Mon, 5 May 2014 16:05:02 +0000 (18:05 +0200)] 
sys: remove unused static variables in Linux driver

11 years agodoc: update for separate client sockets
Miroslav Lichvar [Wed, 30 Apr 2014 16:23:35 +0000 (18:23 +0200)] 
doc: update for separate client sockets

11 years agodoc: update chronyd -r and chronyc -h descriptions
Miroslav Lichvar [Wed, 30 Apr 2014 14:47:46 +0000 (16:47 +0200)] 
doc: update chronyd -r and chronyc -h descriptions

11 years agomain: switch errors in initialization to fatal errors
Miroslav Lichvar [Wed, 30 Apr 2014 14:27:53 +0000 (16:27 +0200)] 
main: switch errors in initialization to fatal errors

11 years agotest: require latest clknetsim
Miroslav Lichvar [Tue, 29 Apr 2014 10:45:41 +0000 (12:45 +0200)] 
test: require latest clknetsim

This is needed for async name resolving and dropping root privileges.

11 years agoclient: shorten default timeout with localhost and async resolving
Miroslav Lichvar [Tue, 29 Apr 2014 10:04:43 +0000 (12:04 +0200)] 
client: shorten default timeout with localhost and async resolving

When chronyd is compiled with asynchronous name resolving, it should
always respond quickly. Shorten the default chronyc timeout for
localhost.

11 years agonameserv: add asynchronous resolving with POSIX threads
Miroslav Lichvar [Wed, 23 Apr 2014 15:50:36 +0000 (17:50 +0200)] 
nameserv: add asynchronous resolving with POSIX threads

Run getaddrinfo()/gethostbyname() in separate thread to avoid blocking.
Only one resolving thread is running at one time, so this should work
also on systems where the functions are not thread-safe.

11 years agoconfigure: check if getaddrinfo() is available
Miroslav Lichvar [Fri, 25 Apr 2014 15:29:59 +0000 (17:29 +0200)] 
configure: check if getaddrinfo() is available

This allows disabling IPv6 support and keeping getaddrinfo().

11 years agontp: start resolving only from NSR_ResolveSources
Miroslav Lichvar [Mon, 28 Apr 2014 13:37:29 +0000 (15:37 +0200)] 
ntp: start resolving only from NSR_ResolveSources

Also, use macros to define the minimum and maximum resolving interval.

11 years agontp: use async name resolving for NTP sources
Miroslav Lichvar [Fri, 25 Apr 2014 14:58:21 +0000 (16:58 +0200)] 
ntp: use async name resolving for NTP sources

Use the new asynchronous call to resolve addresses of NTP servers
configured by the server/peer directives. Introduce a callback to be
notified when the first resolving attempt ends to correctly finish
chronyd initialization (dumpfile reload and reference mode end).

11 years agontp: delay initial transmission until first resolving ends
Miroslav Lichvar [Tue, 29 Apr 2014 09:16:16 +0000 (11:16 +0200)] 
ntp: delay initial transmission until first resolving ends

This will be needed to prevent loading of dump files after sources have
already accumulated samples and possibly reference was already updated
when async resolving of sources is implemented.

11 years agosourcestats: assert dump file is loaded with no accumulated samples
Miroslav Lichvar [Tue, 29 Apr 2014 09:31:21 +0000 (11:31 +0200)] 
sourcestats: assert dump file is loaded with no accumulated samples

11 years agonameserv: prepare for asynchronous resolving
Miroslav Lichvar [Wed, 23 Apr 2014 14:04:47 +0000 (16:04 +0200)] 
nameserv: prepare for asynchronous resolving

Introduce a new function with callback to resolve names to IP addresses
asynchronously. For now, use a blocking wrapper around DNS_Name2IPAddress.

11 years agoconfigure: sed Makefile with MYCPPFLAGS
Miroslav Lichvar [Mon, 28 Apr 2014 17:06:01 +0000 (19:06 +0200)] 
configure: sed Makefile with MYCPPFLAGS

11 years agoconfigure: replace unnecessary variables in Makefile
Miroslav Lichvar [Mon, 28 Apr 2014 16:56:31 +0000 (18:56 +0200)] 
configure: replace unnecessary variables in Makefile

11 years agorefclock: remove duplicated declaration
Miroslav Lichvar [Tue, 29 Apr 2014 09:15:42 +0000 (11:15 +0200)] 
refclock: remove duplicated declaration

11 years agocmdmon: fix doffset command with negative values on 64-bit systems
Miroslav Lichvar [Mon, 28 Apr 2014 11:20:41 +0000 (13:20 +0200)] 
cmdmon: fix doffset command with negative values on 64-bit systems

11 years agoreference: negate offset printed in maxchange log message
Miroslav Lichvar [Fri, 11 Apr 2014 14:09:43 +0000 (16:09 +0200)] 
reference: negate offset printed in maxchange log message

This makes it consistent with other log messages.

11 years agomakefile: add dependency to check target
Miroslav Lichvar [Thu, 10 Apr 2014 16:22:34 +0000 (18:22 +0200)] 
makefile: add dependency to check target

11 years agomain: setup access restrictions before initstepslew
Miroslav Lichvar [Thu, 10 Apr 2014 16:22:09 +0000 (18:22 +0200)] 
main: setup access restrictions before initstepslew

11 years agontp: close client socket when offline
Miroslav Lichvar [Thu, 10 Apr 2014 15:59:08 +0000 (17:59 +0200)] 
ntp: close client socket when offline

11 years agontp: close only client socket when destroying NCR instance
Miroslav Lichvar [Thu, 10 Apr 2014 15:25:28 +0000 (17:25 +0200)] 
ntp: close only client socket when destroying NCR instance

11 years agosources: ignore inactive sources in special mode ending
Miroslav Lichvar [Thu, 10 Apr 2014 15:11:20 +0000 (17:11 +0200)] 
sources: ignore inactive sources in special mode ending

11 years agosources: add flag that source is active
Miroslav Lichvar [Thu, 10 Apr 2014 14:53:28 +0000 (16:53 +0200)] 
sources: add flag that source is active

When source is set as active, it's receiving reachability updates (e.g.
offline NTP sources are not active).

Also add function to count active sources.

11 years agontp: reduce burst timeout to 2.0
Miroslav Lichvar [Thu, 10 Apr 2014 13:49:42 +0000 (15:49 +0200)] 
ntp: reduce burst timeout to 2.0

With the new special mode ending it can be now equal to the burst
polling interval.

11 years agosources: rework special mode ending with unreachable sources
Miroslav Lichvar [Thu, 10 Apr 2014 13:45:11 +0000 (15:45 +0200)] 
sources: rework special mode ending with unreachable sources

Instead of giving up when a source has 7 reach updates, continue as long
as at least one source has fewer than 7 updates and can still have 3
samples to be selectable in that number of updates.

When no sources are responding, it will give up sooner.

11 years agoregress: make minimum number of samples for regression public
Miroslav Lichvar [Thu, 10 Apr 2014 14:31:48 +0000 (16:31 +0200)] 
regress: make minimum number of samples for regression public

11 years agosched: fix main loop to allow timeout handlers modify fd set or quit
Miroslav Lichvar [Thu, 10 Apr 2014 09:42:47 +0000 (11:42 +0200)] 
sched: fix main loop to allow timeout handlers modify fd set or quit

With special reference update modes, the timeout handlers may add or
remove file descriptors from the read fd set, so it needs to be copied
for select() call after they are dispatched. Also, they can now request
quit, so the exit flag needs to be checked before select() to avoid
hanging.

11 years agoconfigure: add option to set default user
Miroslav Lichvar [Wed, 9 Apr 2014 14:28:44 +0000 (16:28 +0200)] 
configure: add option to set default user

The default user is root by default, which disables root dropping by
default. The user directive or the -u option can still be used to set
the user.

11 years agomain: support configuration commands on command line
Miroslav Lichvar [Wed, 9 Apr 2014 13:12:53 +0000 (15:12 +0200)] 
main: support configuration commands on command line

If there are extra arguments on the chronyd command line, they will be
parsed as lines in a configuration file and the normal configuration file
will be ignored.

11 years agoconf: allow NULL as filename
Miroslav Lichvar [Wed, 9 Apr 2014 10:55:50 +0000 (12:55 +0200)] 
conf: allow NULL as filename

11 years agoconf: split line parsing from CNF_ReadFile
Miroslav Lichvar [Wed, 9 Apr 2014 10:36:13 +0000 (12:36 +0200)] 
conf: split line parsing from CNF_ReadFile

11 years agomain: add -q/-Q options to set clock/print offset once and exit
Miroslav Lichvar [Wed, 9 Apr 2014 10:12:12 +0000 (12:12 +0200)] 
main: add -q/-Q options to set clock/print offset once and exit

11 years agoreference: add UpdateOnce and PrintOnce modes
Miroslav Lichvar [Wed, 9 Apr 2014 10:11:21 +0000 (12:11 +0200)] 
reference: add UpdateOnce and PrintOnce modes

11 years agologging: print warning message when not compiled with debug support
Miroslav Lichvar [Wed, 9 Apr 2014 09:01:01 +0000 (11:01 +0200)] 
logging: print warning message when not compiled with debug support

11 years agologging: set debug level instead of on/off
Miroslav Lichvar [Tue, 8 Apr 2014 16:44:17 +0000 (18:44 +0200)] 
logging: set debug level instead of on/off

Prefix messages written to terminal with filename, line and function
name only with debug level 2 and higher.

11 years agologging: update format of messages written to terminal
Miroslav Lichvar [Wed, 9 Apr 2014 08:34:14 +0000 (10:34 +0200)] 
logging: update format of messages written to terminal

Move the time stamp to start of the line and print full date in ISO 8601
format.

11 years agoreference: exit with non-zero code when maxchange limit is reached
Miroslav Lichvar [Mon, 7 Apr 2014 16:26:16 +0000 (18:26 +0200)] 
reference: exit with non-zero code when maxchange limit is reached

Use ending of normal mode to signal a failure.

11 years agosources: log selection messages only in normal reference update mode
Miroslav Lichvar [Mon, 7 Apr 2014 15:45:54 +0000 (17:45 +0200)] 
sources: log selection messages only in normal reference update mode

We don't want to see source selection messages when initstepslew is
running.

11 years agontp: reduce burst timeout to 2.5 seconds
Miroslav Lichvar [Mon, 7 Apr 2014 15:11:23 +0000 (17:11 +0200)] 
ntp: reduce burst timeout to 2.5 seconds

This reduces the maximum time initstepslew can take.

11 years agontp: set maximum number of iburst samples to size of reach register
Miroslav Lichvar [Mon, 7 Apr 2014 14:15:40 +0000 (16:15 +0200)] 
ntp: set maximum number of iburst samples to size of reach register

Explicitly set the number of iburst samples to the size of the register
to make sure there are at least 7 reachability updates and the
initstepslew mode can be ended.

11 years agontp: drop initstepslew NTP implementation
Miroslav Lichvar [Mon, 7 Apr 2014 15:27:44 +0000 (17:27 +0200)] 
ntp: drop initstepslew NTP implementation

The initstepslew code has its own minimal NTP implementation. Drop the
code, add a new initstepslew mode to the reference updating code and
use regular NTP sources with iburst flag for initstepslew addresses
instead. When an update is made or a source is found unreachable, log a
message, remove the initstepslew sources and switch to normal mode.

This reduces code duplication and makes initstepslew use features
implemented only in the main code like source combining or SO_TIMESTAMP
support.

11 years agosources: replace beginning flag with size of reachability register
Miroslav Lichvar [Mon, 7 Apr 2014 13:33:01 +0000 (15:33 +0200)] 
sources: replace beginning flag with size of reachability register

This will allow to detect sources that are not reachable on start.

11 years agosources: split source selection from sample accumulation
Miroslav Lichvar [Thu, 3 Apr 2014 16:11:37 +0000 (18:11 +0200)] 
sources: split source selection from sample accumulation

This will allow postponing source selection and reference update, which
could be useful in burst modes.

11 years agogit: update .gitignore
Miroslav Lichvar [Tue, 8 Apr 2014 14:59:02 +0000 (16:59 +0200)] 
git: update .gitignore

11 years agotest: add missing run script
Miroslav Lichvar [Tue, 8 Apr 2014 14:57:05 +0000 (16:57 +0200)] 
test: add missing run script

11 years agoconf: add bindacqaddress directive for client sockets
Miroslav Lichvar [Thu, 3 Apr 2014 13:44:43 +0000 (15:44 +0200)] 
conf: add bindacqaddress directive for client sockets

11 years agontp: set only necessary socket options on client sockets
Miroslav Lichvar [Thu, 3 Apr 2014 11:26:17 +0000 (13:26 +0200)] 
ntp: set only necessary socket options on client sockets

11 years agotest: add 112-port
Miroslav Lichvar [Wed, 26 Mar 2014 11:09:09 +0000 (12:09 +0100)] 
test: add 112-port

11 years agontp: fix comment on NCR_ProcessUnknown
Miroslav Lichvar [Wed, 26 Mar 2014 10:24:25 +0000 (11:24 +0100)] 
ntp: fix comment on NCR_ProcessUnknown

11 years agontp: accept packets from unknown sources only from server sockets
Miroslav Lichvar [Wed, 26 Mar 2014 10:15:09 +0000 (11:15 +0100)] 
ntp: accept packets from unknown sources only from server sockets

11 years agotest: update for latest clknetsim
Miroslav Lichvar [Tue, 25 Mar 2014 16:33:55 +0000 (17:33 +0100)] 
test: update for latest clknetsim

Latest clknetsim now allows source and destination port numbers to
differ. This fixes the tests to work with the recent changes that added
client NTP sockets.

11 years agontp: don't create server sockets if port is configured to 0
Miroslav Lichvar [Tue, 25 Mar 2014 14:07:55 +0000 (15:07 +0100)] 
ntp: don't create server sockets if port is configured to 0

11 years agontp: use separate connected sockets for each server
Miroslav Lichvar [Tue, 25 Mar 2014 13:26:50 +0000 (14:26 +0100)] 
ntp: use separate connected sockets for each server

If acquisitionport is set to 0 (default), create and connect a new
socket for each server instead of using one socket per address family
for all servers.

11 years agontp: use separate client sockets
Miroslav Lichvar [Tue, 25 Mar 2014 11:13:36 +0000 (12:13 +0100)] 
ntp: use separate client sockets

Use separate sockets for NTP server or peer and client packets. The port
number is configured by the acquisitionport directive. With the default
value of 0 the port is assigned randomly by the kernel. It can be equal
to the value configured by the port directive to use the server sockets
for all packets as before.

11 years agontp: don't try to bind acquire socket if port is equal to ntp port
Miroslav Lichvar [Tue, 25 Mar 2014 10:51:40 +0000 (11:51 +0100)] 
ntp: don't try to bind acquire socket if port is equal to ntp port

11 years agontp: check if packet was received by right socket
Miroslav Lichvar [Mon, 24 Mar 2014 16:10:35 +0000 (17:10 +0100)] 
ntp: check if packet was received by right socket

11 years agontp: store socket in NTP instance
Miroslav Lichvar [Mon, 24 Mar 2014 15:47:58 +0000 (16:47 +0100)] 
ntp: store socket in NTP instance

This is preparation for separate client sockets.

11 years agontp: split local_ip_addr from NTP_Remote_Address struct
Miroslav Lichvar [Mon, 24 Mar 2014 14:53:43 +0000 (15:53 +0100)] 
ntp: split local_ip_addr from NTP_Remote_Address struct

11 years agontp: set invalid socket fd by macro
Miroslav Lichvar [Mon, 24 Mar 2014 12:48:28 +0000 (13:48 +0100)] 
ntp: set invalid socket fd by macro

11 years agodoc: improve commandkey and keyfile descriptions
Miroslav Lichvar [Fri, 21 Mar 2014 14:47:33 +0000 (15:47 +0100)] 
doc: improve commandkey and keyfile descriptions

11 years agontp: set minpoll from received KoD RATE at most to 10
Miroslav Lichvar [Fri, 21 Mar 2014 14:28:33 +0000 (15:28 +0100)] 
ntp: set minpoll from received KoD RATE at most to 10

Limit changing minpoll to a reasonable maximum in case the server is
broken or temporarily misconfigured.

11 years agontp: print warning when source is added with unknown key
Miroslav Lichvar [Fri, 21 Mar 2014 13:29:12 +0000 (14:29 +0100)] 
ntp: print warning when source is added with unknown key

11 years agontp: reset negative minpoll or maxpoll to default values
Miroslav Lichvar [Fri, 21 Mar 2014 12:16:37 +0000 (13:16 +0100)] 
ntp: reset negative minpoll or maxpoll to default values

11 years agocmdparse: don't allow NTP key ID of 0
Miroslav Lichvar [Fri, 21 Mar 2014 11:47:52 +0000 (12:47 +0100)] 
cmdparse: don't allow NTP key ID of 0

Key number 0 is used as inactive key, prevent the user from
inadvertently not using authentication.

11 years agotest: add 111-knownclient
Miroslav Lichvar [Fri, 21 Mar 2014 11:05:48 +0000 (12:05 +0100)] 
test: add 111-knownclient

11 years agotest: add port number check
Miroslav Lichvar [Fri, 21 Mar 2014 11:04:10 +0000 (12:04 +0100)] 
test: add port number check

11 years agontp: make use of NCR_ProcessUnknown in NCR_ProcessKnown
Miroslav Lichvar [Thu, 20 Mar 2014 18:14:47 +0000 (19:14 +0100)] 
ntp: make use of NCR_ProcessUnknown in NCR_ProcessKnown

After recent changes the code in NCR_ProcessKnown is now identical and
can be replaced with NCR_ProcessUnknown call.

11 years agontp: don't store tx time stamp when replying to known source
Miroslav Lichvar [Thu, 20 Mar 2014 18:09:04 +0000 (19:09 +0100)] 
ntp: don't store tx time stamp when replying to known source

11 years agontp: don't reply to known source if missing key or invalid auth
Miroslav Lichvar [Thu, 20 Mar 2014 18:00:08 +0000 (19:00 +0100)] 
ntp: don't reply to known source if missing key or invalid auth

This is now similar to replying to unknown sources.

11 years agotest: extend 105-ntpauth
Miroslav Lichvar [Thu, 20 Mar 2014 17:46:41 +0000 (18:46 +0100)] 
test: extend 105-ntpauth

11 years agontp: don't send requests with unknown key
Miroslav Lichvar [Thu, 20 Mar 2014 17:29:44 +0000 (18:29 +0100)] 
ntp: don't send requests with unknown key

There is no point in sending a request if the configured key is missing.
A reply would be ignored anyway.