Dave Hart [Sun, 11 Apr 2010 23:13:44 +0000 (23:13 +0000)]
Documentation updates for 4.2.7p22 changes and additions, updating
ntpdc.html, ntpq.html, accopt.html, confopt.html, manyopt.html,
miscopt.html, and miscopt.txt.
Modify full MRU list preemption when full to match "discard monitor"
documentation, by removing exception for count == 1.
Dave Hart [Sun, 4 Apr 2010 04:07:40 +0000 (04:07 +0000)]
[Bug 1516] unpeer by IP address fails, DNS name works.
[Bug 1517] ntpq and ntpdc should verify reverse DNS before use.
ntpq and ntpdc now use the following format for showing purported
DNS names from IP address "reverse" DNS lookups when the DNS name
does not exist or does not include the original IP address among
the results: "192.168.1.2 (fake.dns.local)".
Dave Hart [Thu, 25 Mar 2010 16:12:20 +0000 (16:12 +0000)]
ntpq-subs.c:
Add ntpq "mrulist limited" and "mrulist kod" support, equivalent to
ntpq -c "mrulist resany=0x20" and ntpq -c "mrulist resany=0x400"
respectively.
Add "r" rate limiting column to mrulist output containing a period,
or K for KoD sent in response to last packet, or L for no response
to last packet due to rate limiting. These are redundant with bits
0x400 and 0x20 in the rstr column and treated differently than other
restrict bits, reflecting not if the restriction bit is enabled for
the remote address, but if RES_KOD or RES_LIMITED handling was
triggered by the last packet from them.
it.
ntp.h, ntpdc_ops.c, ntp_proto.c, ntp_config.c:
rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
drops 10% of incoming packets from matching addresses).
ntp_intres.c:
rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
drops 10% of incoming packets from matching addresses), eliminating
conflict with RES_TIMEOUT provided by some systems DNS headers.
Dave Hart [Thu, 25 Mar 2010 01:42:06 +0000 (01:42 +0000)]
ChangeLog:
Catch up ChangeLog with several weeks' changes.
ntpq-subs.c, ntp_peer.c, ntp_io.c, ntp_proto.c:
debug message cleanup for integration with ntp-dev
ntp_fp.h:
fix prototype for 'dolfptoa'
dolfptoa.c:
avoid pointer wrap-around warnings, fixed prototype,
did some rework to make the implementation cleaner.
Dave Hart [Wed, 10 Mar 2010 03:02:42 +0000 (03:02 +0000)]
Fetch 32 rows initially in ntpq -cmrulist.
Tweak runtime adjustment of limit in response to errors, now
will grow number of rows 50% each success and cut it in
half each failure.
Sleep 0.3s instead of 1s between requests in ntpq -cmrulist
on platforms that have nanosleep() or similar.
Dave Hart [Tue, 9 Mar 2010 15:11:28 +0000 (15:11 +0000)]
ntpq-subs.c:
use "sort=lstint" and "sort=-lstint" for default and reverse
default sort order of "ntpq -c mrulist"
ntp_control.c:
Attempt to enforce clients ignoring unknown tag=value pairs
in CTL_OP_READ_MRU (ntpq -c mrulist) by including a randomly-
named tag in the last row.
Dave Hart [Tue, 9 Mar 2010 01:53:35 +0000 (01:53 +0000)]
Add "sort=avgint" option to mrulist: ntpq -c "mru sort=avgint".
Add "sort=addr" option to mrulist to sort by remote address.
Remove check for qsort() using other than void *, ANSI C is
required and it ensures void * for qsort().
Dave Hart [Sun, 7 Mar 2010 20:01:29 +0000 (20:01 +0000)]
rate limit ntpdate packets to 2s interval per server to stay
within the "restrict ... limited" default limit set by
"discard minimum 1", plus 1s of enforcement slop.
Respect KoD rate-limiting responses from ntpd.
Dave Hart [Sun, 7 Mar 2010 17:36:49 +0000 (17:36 +0000)]
ntp_util.c:
whitespace only
ntpq-subs.c:
split mrulist() into mrulist() and collect_mru_list().
adjust row limit based on success/failure of individual
queries for collect_mru_list().
revert to one MRU entry per IP address regardless of port.
ntp_monitor.c:
correct MRU list preemption logic.
revert to one MRU entry per IP address regardless of port.
ntp_control.h, ntp_control.c:
add "kod_sent" non-default system variable for sys_kodsent.
config.h:
#undef STRINGIZE after use to avoid accidentally using on
Windows without noticing it's specific to Windows port.
ntpq.c, ntpq.h:
move definitions to ntpq.h needed by mrulist code in
ntpq-subs.h.
Dave Hart [Fri, 5 Mar 2010 19:22:27 +0000 (19:22 +0000)]
ntpq-subs.c:
use ========= instead of --------- to separate column headings
from rows in mrulist().
ntp_config.c:
unpeer by hostname, needed to unpeer pool prototype
assocations.
Dave Hart [Thu, 4 Mar 2010 17:17:47 +0000 (17:17 +0000)]
new "ntpq -c mrulist" along lines of "ntpdc -c monlist" but
without being limited to a single request response, and
designed to work reliably even with an arbitrarily large
MRU list.
Dave Hart [Tue, 2 Mar 2010 10:00:34 +0000 (10:00 +0000)]
ntp_net.h:
add ADDR_EQ_PORT() like SOCK_EQ() but testing port as well.
ntpq-subs.c, ntpq.c, ntpq.h:
use associd_t for association IDs instead of int.
systime.c, ntp_fp.h:
provide callback from step_systime() to allow ntpd to flush
the MRU list when stepping the clock.
ntp_proto.c:
use u_short for restrict_mask type in receive(), expand comment.
ntp_util.c:
Use callback from step_systime() to flush the MRU list when
stepping the clock. Previously the MRU timestamps were in
current_time units, which are monotonically increasing despite
any steps of the system clock. Now they are l_fp and subject
to steps, so flush the MRU list when the clock is stepped to
ensure all timestamps are comparable.
recvbuff.h:
whitespace only
ntp_request.c:
prepare for ntpq mrulist command by converting MRU entry timestamps
from current_time (seconds) to l_fp (32:32 NTP standard).
rename info_monitor, info_monitor_1 fields to reflect their
use, lasttime -> avg_int and firsttime -> last_int.
ntp_iocompletionport.c:
validate recv_srcadr_len against (now smaller) sockaddr_u size.
ntp_control.h:
add CTL_OP_READMRU for ntpq mrulist
ntpd.h:
add prototype for win_time_stepped(), previously called
time_stepped().
ntp_control.c:
add CTL_OP_READ_MRU for ntpq -c mrulist
layout.std, ntpdc_ops.c:
rename info_monitor, info_monitor_1 fields to reflect their
use, lasttime -> avg_int and firsttime -> last_int
ntp_restrict.c:
wrap a long line
ntp_monitor.c, ntp.h:
prepare for ntpq mrulist command by converting MRU entry timestamps
from current_time (seconds) to l_fp (32:32 NTP standard).
ntp_request.h:
rename info_monitor, info_monitor_1 fields to reflect their
use, lasttime -> avg_int and firsttime -> last_int.
SetSystemTime.c, nt_clockstuff.c, clockstuff.h:
rename time_stepped() callback to win_time_stepped(), move
callback registration from Windows port to portable code
now that ntpd/ntp_util.c is using it.
Dave Hart [Mon, 1 Mar 2010 12:47:33 +0000 (12:47 +0000)]
determine MRU hash table size at runtime, attempting to
average 8 entries per bucket at mru_maxdepth capacity.
adjust defaults for mru_maxdepth, mru_initmem.
Dave Hart [Sat, 27 Feb 2010 22:48:05 +0000 (22:48 +0000)]
Many files:
more MRU knobs
ntp_keyword.h, keyword-gen-utd:
keyword-gen.c product
ntp_parser.h, ntp_parser.c:
ntp_parser.y product
ntp_request.c:
limit 'ntpdc -c monlist' response to most recent 600 entries, to
be consistent with the historical maximum MRU list size.
ntpq-subs.c:
read up to three named variables at once:
ntpq -c "rv 0 version mru_depth mru_maxmem"
Dave Hart [Sat, 27 Feb 2010 08:47:04 +0000 (08:47 +0000)]
ntp_parser.h, ntp_parser.c:
product of ntp_parser.y
keyword-gen-utd:
accompanies new keyword-gen.c and ntp_keyword.h
Many files:
add MRU sizing knobs:
mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
entries beyond 600 which are older than 64s are reclaimed,
with a hard upper limit on the size of maxdepth (indirectly
set by maxmem).
ntp.h, ntp_request.c:
remove redundant storage of port in mon_entry, rmtadr has it.
ntp_keyword.h:
product of keyword-gen.c
Dave Hart [Fri, 26 Feb 2010 22:59:36 +0000 (22:59 +0000)]
ntp_config.c:
Dr. Mills doesn't like depending on && not evaluating right side
if left is false.
ntp_proto.c:
timeout demobilizations don't seem to be working for preemptibles.
Dave Hart [Fri, 26 Feb 2010 15:53:49 +0000 (15:53 +0000)]
ntpq-subs.c:
just the facts, ma'am
ntp_control.c:
DLM changes via email notes
ntp_proto.c:
DLM changes via email notes.
remove "unlucky" experiment to track DLM changes.
Dave Hart [Thu, 25 Feb 2010 15:45:14 +0000 (15:45 +0000)]
nt_clockstuff.c:
suppress reports of interpolated clock "would have" gone backward
for less than 10 usec.
ntp_proto.c:
experiment with turning over 50% of preemptibles daily
Dave Hart [Thu, 25 Feb 2010 06:34:58 +0000 (06:34 +0000)]
ntp_proto.c:
cull from preemptibles randomly as well as when unreachable
long enough.
work_thread.c:
increase blocking_workitems max queue depth to 128 on Windows
ntp_control.h:
whitespace only
nt_clockstuff.c:
expose performance counter drift as ctr_frequency sysvar.
ntp_intres.c, ntpd.h, ntp_config.c:
add retry argument to getaddrinfo_sometime() so that pool lookups
can be one-shot.
ntp_peer.c:
test speer->flags not peer->flags for FLAG_PREEMPT
Reg Clemens [Thu, 25 Feb 2010 05:53:22 +0000 (00:53 -0500)]
This is a group of 4 patches that
(1) replace blanks with tabs in the source.
(2) provide a cleaner solution to turning FLAG_PPS on/off in oncore_get_timestamp.
(3) change LOG_INFO -> LOG_DEFAULT for one message, reducing the extraneous message
in the messages log.
(4) an implementation of [Bug1390] initially provided by Russell Yount, to turn the
PPS signal on/off. Note that this does NOT affect timekeeping.
Dave Hart [Wed, 17 Feb 2010 09:54:32 +0000 (09:54 +0000)]
[Bug 1483] AI_NUMERICSERV undefined in 4.2.7p20.
Maintain and use linked list of associations (struct peer) in ntpd,
avoiding walking 128 hash table entries to iterate over peers.
Remove more workarounds unneeded since we require ISO C90 AKA ANSI C:
- remove fallback implementations for memmove(), memset, strstr().
- do not test for atexit() or memcpy().
Collapse a bunch of code duplication in ntpd/ntp_restrict.c added with
support for IPv6.
Correct some corner case failures in automatically enabling the MRU
list if any "restrict ... limited" is in effect, and in disabling MRU
maintenance. (ntp_monitor.c, ntp_restrict.c)
Reverse the internal sort order of the address restriction lists, but
preserve the same behavior. This allows removal of special-case code
related to the default restrictions and more straightforward lookups
of restrictions for a given address (now, stop on first match).
Move ntp_restrict.c MRU doubly-linked list maintenance code into
ntp_lists.h macros, allowing more duplicated source excision.
Correct Windows port's refclock_open() to return 0 on failure not -1.
Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
refclock_open() on failure.
Repair ntpdate.c to handle no longer testing HAVE_TIMER_SETTIME.
Do not reference peer_node/unpeer_node after freeing when built with
--disable-saveconfig and using DNS.
Dave Hart [Mon, 15 Feb 2010 23:19:19 +0000 (23:19 +0000)]
[Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27)
and SHM (28).
Correct Windows port's refclock_open() to return 0 on failure not -1.
Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
refclock_open() on failure.
Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one.
Dave Hart [Tue, 9 Feb 2010 18:19:12 +0000 (18:19 +0000)]
[Bug 1483] hostname in ntp.conf "restrict" parameter rejected.
Use all addresses for each restrict by hostname.
Use async DNS to resolve trap directive hostnames.
Dave Hart [Mon, 8 Feb 2010 14:11:12 +0000 (14:11 +0000)]
[Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
[Bug 1479] Compilation fails because of not finding readline headers.
[Bug 1484] ushort is not defined in QNX6.