]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Merge whimsy.udel.edu:/deacon/backroom/ntp-stable
authorHarlan Stenn <stenn@ntp.org>
Sat, 17 May 2008 21:28:25 +0000 (17:28 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 17 May 2008 21:28:25 +0000 (17:28 -0400)
into  whimsy.udel.edu:/deacon/backroom/ntp-dev-hms

bk: 482f4df9ZGDLlwoqz454lLpr30tU1Q

1  2 
ChangeLog
configure.ac
include/copyright.def
include/ntpd.h
libntp/recvbuff.c
ntpd/cmd_args.c
ntpd/ntp_config.c
ntpd/ntp_intres.c
ntpd/ntp_io.c
ntpd/ntpd.c
ntpdate/ntpdate.c

diff --cc ChangeLog
index daa15f01bebc912a2073e81bff76573bba04134d,177b3dff8e672917790ebe47d9c5d3aa65e1fcea..f0e734bca2328134ddc2fe1b85adc78becc116b9
+++ b/ChangeLog
 ----
 +* [Bug 1022] Fix compilation problems with yesterday's commit.
 +* Updates and cleanup from Dave Mills:
 +  I've now spent eleven months of a sabbatical year - 7 days a week, 6-10
 +  hours most days - working on NTP. I have carefully reviewed every major
 +  algorithm, examined its original design and evolution from that design.
 +  I've trimmed off dead code and briar patches and did zillions of tests
 +  contrived to expose evil vulnerabilities. The development article is in
 +  rather good shape and should be ready for prime time.
 +
 +  1. The protostats statistics files have been very useful in exposing
 +  little twitches and turns when something hiccups, like a broken PPS
 +  signal. Most of what used to be syslog messages are now repackaged as
 +  protostats messages with optional syslog as well. These can also be sent
 +  as traps which might be handy to tiggle a beeper or celltext. These, the
 +  sysstats files and cryptostats files reveal the ambient health of a busy
 +  server, monitor traffic and error counts and spot crypto attacks.
 +
 +  2. Close inspection of the clock discipline behavior at long poll
 +  intervals (36 h) showed it not doing as well as it should. I redesigned
 +  the FLL loop to improve nominal accuracy from  several tens of
 +  milliseconds to something less than ten milliseconds.
 +
 +  3. Autokey (again). The enhanced error checking was becoming a major
 +  pain. I found a way to toss out gobs of ugly fat code and replace the
 +  function with a much simpler and more comprehensive scheme. It resists
 +  bait-and-switch attacks and quickly detect cases when the protocol is
 +  not correctly synchronized.
 +
 +  4. The interface code for the kernel PPS signal was not in sync with the
 +  kernel code itself. Some error checks were duplicated and some
 +  ineffective. I found none of the PPS-capable drivers, including the atom
 +  driver, do anything when the prefer peer fails; the kernel PPS signal
 +  remains in control. The atom driver now disables the kernel PPS when the
 +  prefer peer comes bum. This is important when the prefer peer is not a
 +  reference clock but a remote NTP server.
 +
 +  5. The flake restrict bit turned out to be really interesting,
 +  especially with symmtric modes and of those especially those using
 +  Autokey. Small changes in the recovery procedures when packets are lost
 +  now avoid almost all scenarios which previously required protocol resets.
 +
 +  6. I've always been a little uncomfortable when using the clock filter
 +  with long poll intervals because the samples become less and less
 +  correlated as the sample age exceeds the Allan intercept. Various
 +  schemes have been used over the years to cope with this fact. The latest
 +  one and the one that works the best is to use a modified sort metric
 +  where the delay is used when the age of the sample is less than the
 +  intercept and the sum of delay and dispersion above that. The net result
 +  is that, at small poll intervals the algorithm operates as a minimum
 +  filter, while at larger poll intervals it morphs to FIFO. Left
 +  unmodified, a sample could be used when twelve days old. This along with
 +  the FLL modifications has made a dramatic improvement at large poll
 +  intervals.
 +
 +- [Backward Incompatible] The 'state' variable is no longer reported or
 +  available via ntpq output.  The following system status bit names
 +  have been changed:
 +  - sync_alarm -> leap_alarm
 +  - sync_atomic -> sync_pps
 +  - sync_lf_clock -> sync_lf_radio
 +  - sync_hf_clock -> sync_hf_radio
 +  - sync_uhf_clock -> sync_uhf_radio
 +  - sync_local_proto -> sync_local
 +  - sync_udp/time -> sync_other
 +  Other names have been changed as well.  See the change history for
 +  libntp/statestr.c for more details.
 +  Other backward-incompatible changes in ntpq include:
 +  - assID -> associd
 +  - rootdispersion -> rootdisp
 +  - pkt_head -> pkt_neader
 +  See the change history for other details.
 +
 +* Updates and cleanup from Dave Mills.
 +* [Bug 995] Remove spurious ; from ntp-keygen.c.
 +* More cleanup and changes from Dave Mills.
 +* [Bug 980] Direct help to stdout.
 +* [Bug 959] Refclock on Windows not properly releasing recvbuffs.
 +* [Bug 993] Fix memory leak when fetching system messages.
 +* much cleanup, fixes, and changes from Dave Mills.
 +* ntp_control.c: LEAPTAB is a filestamp, not an unsigned.  From Dave Mills.
 +* ntp_config.c: ntp_minpoll fixes from Dave Mills.
 +* ntp-keygen updates from Dave Mills.
 +* refresh epoch, throttle, and leap cleanup from Dave Mills.
 +* Documentation cleanup from Dave Mills.
 +* [Bug 918] Only use a native md5.h if MD5Init() is available.
 +* [Bug 979] Provide ntptimeval if it is not otherwise present.
 +* [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork.
 +* [Bug 952] Use md5 code with a friendlier license.
 +* [Bug 977] Fix mismatching #ifdefs for builds without IPv6.
 +* [Bug 830] Fix the checking order of the interface options.
 +* Clean up the logfile/syslog setup.
 +* [Bug 970] Lose obsolete -g flag to ntp-keygen.
 +* The -e flag to ntp-keygen can write GQ keys now, too.
 +* ntp_proto.c: sys_survivors and hpoll cleanup from Dave Mills.
 +* ntp_loopfilter.c: sys_poll cleanup from Dave Mills.
 +* refclock_wwv.c: maximum-likelihood digit and DSYNC fixes from Dave Mills.
 +* [Bug 967] preemptable associations are lost forever on a step.
 +* ntp_config.c: [CID 48] missing "else" clause.
 +* [Bug 833] ntpq config keyword is quote-mark unfriendly.
 +* Rename the ntpq "config" keyword to ":config".
 +* Dave Mills shifted some orphan processing.
 +* Fix typos in the [Bug 963] patch.
 +* bootstrap: squawk if genver fails.  Use -f with cp in case Dave does a chown.
 +* Remove obsolete simulator command-line options.
 +* ntp_request.c: [CID 36] zero sin_zero.
 +* [Bug 963] get_systime() is too noisy.
 +* [Bug 960] spurious syslog:crypto_setup:spurious crypto command
 +* [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux.
 +* Changes from Dave Mills:
 +  - ntp_util.c: cleanup.
 +  - ntp_timer.c: watch the non-burst packet rate.
 +  - ntp_request.c: cleanup.
 +  - ntp_restrict.c: RES_LIMITED cleanup.
 +  - ntp_proto.c: RES_LIMITED, rate bucktes, counters, overall cleanup.
 +  - ntp_peer.c: disallow peer_unconfig().
 +  - ntp_monitor.c: RES_LIMITED cleanup.
 +  - ntp_loopfilter.c: poll interval cleanup.
 +  - ntp_crypto.c: volley -> retry.  Cleanup TAI leap message.
 +  - ntp_config: average and minimum are ^2 values.
 +  - ntpdc: unknownversion is really "declined", not "bad version".
 +  - Packet retry cleanup.
 +* [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice.
 +* [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI
 +  override the standard parameters from the ImagePath registry key.
 +* Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions.
 +* Work around a VPATH difference in FreeBSD's 'make' command.
 +* Update bugreport URL.
 +* Update -I documentation.
 +* [Bug 713] Fix bug reporting information.
 +* A bug in the application of the negative-sawtooth for 12 channel receivers. 
 +* The removal of unneeded startup code used for the original LinuxPPS, it now
 +  conforms to the PPSAPI and does not need special code.  
 +* ntp-keygen.c: Coverity fixes [CID 33,47].
 +* Volley cleanup from Dave Mills.
 +* Fuzz cleanup from Dave Mills.
 +* [Bug 861] Leap second cleanups from Dave Mills.
 +* ntpsim.c: add missing protypes and fix [CID 34], a nit.
 +* Upgraded bison at UDel.
 +* Update br-flock and flock-build machine lists.
 +* [Bug 752] QoS: add parse/config handling code. 
 +* Fix the #include order in tickadj.c for picky machines.
 +* [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h.
 +* [Bug 752] Update the QoS tagging (code only - configuration to follow).
 +* Orphan mode and other protocol cleanup from Dave Mills.
 +* Documentation cleanup from Dave Mills.
 +* [Bug 940] ntp-keygen uses -v.  Disallow it as a shortcut for --version.
 +* more cleanup to ntp_lineeditlibs.m4.
 +* Documentation updates from Dave Mills.
 +* -ledit cleanup for ntpdc and ntpq.
 +* Association and other cleanup from Dave Mills.
 +* NTP_UNREACH changes from Dave Mills.
 +* Fix the readline history test.
 +* [Bug 931] Require -lreadline to be asked for explicitly.
 +* [Bug 764] When looking for -lreadline support, also try using -lncurses.
 +* [Bug 909] Fix int32_t errors for ntohl().
 +* [Bug 376/214] Enhancements to support multiple if names and IP addresses.
 +* [Bug 929] int32_t is undefined on Windows.  Casting wrong.
 +* [Bug 928] readlink missing braces.
 +* [Bug 788] Update macros to support VS 2005.
 +* ntpd/ntp_timer.c: add missing sys_tai parameter for debug printf
 +* [Bug 917] config parse leaves files open
 +* [Bug 912] detect conflicting enable/disable configuration on interfaces
 +  sharing an IP address
 +* [Bug 771] compare scopeid if available for IPv6 addresses
 +* Lose obsolete crypto subcommands (Dave Mills).
 +* WWV is an HF source, not an LF source (Dave Mills).
 +* [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT.
 +* [Bug 916] 'cryptosw' is undefined if built without OpenSSL.
 +* [Bug 891] 'restrict' config file keyword does not work (partial fix).
 +* [Bug 890] the crypto command seems to be required now.
 +* [Bug 915] ntpd cores during processing of x509 certificates.
 +* Crypto lint cleanup from Dave Mills.
 +* [Bug 897] Check RAND_status() - we may not need a .rnd file.
 +* Crypto cleanup from Dave Mills.
 +* [Bug 911] Fix error message in cmd_args.c.
 +* [Bug 895] Log assertion failures via syslog(), not stderr.
 +* Documentation updates from Dave Mills.
 +* Crypto cleanup from Dave Mills.
 +* [Bug 905] ntp_crypto.c fails to compile without -DDEBUG.
 +* Avoid double peer stats logging.
 +* ntp-keygen cleanup from Dave Mills.
 +* libopts needs to be built after ElectricFence.
 +* [Bug 894] Initialize keysdir before calling crypto_setup().
 +* Calysto cleanup for ntpq.
 +* ntp-keygen -i takes an arg.
 +* Cleanup and fixes from Dave Mills.
 +* [Bug 887] Fix error in ntp_types.h (for sizeof int != 4).
 +* Bug 880 bug fixes for Windows build
 +* Improve Calysto support.
 +* The "revoke" parameter is a crypto command.
 +* The driftfile wander threshold is a real number.
 +* [Bug 850] Fix the wander threshold parameter on the driftfile command.
 +* ntp_io.c: Dead code cleanup - Coverity View 19.
 +* Leap file related cleanup from Dave Mills.
 +* ntp_peer.c: Set peer->srcadr before (not after) calling set_peerdstadr().
 +* Initialize offset in leap_file() - Coverity View 17.
 +* Use the correct stratum on KISS codes.
 +* Fuzz bits cleanup.
 +* Show more digits in some debug printf's.
 +* Use drift_file_sw internally to control writing the drift file.
 +* Implement the wander_threshold option for the driftfile config keyword.
 +* reformat ntp_control.c; do not use c++ // comments.
 +* [Bug 629] Undo bug #629 fixes as they cause more problems than were  being
 +  solved
 +* Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup,
 +  driftfile write cleanup, packet buffer length checks, documentation updates.
 +* More assertion checks and malloc()->emalloc(), courtesy of Calysto.
 +* [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
 +* [Bug 862] includefile nesting; preserve phonelist on reconfig.
 +* [Bug 604] ntpd regularly dies on linux/alpha.
 +* more leap second infrastructure fixes from Dave Mills.
 +* [Bug 858] recent leapfile changes broke non-OpenSSL builds.
 +* Use emalloc() instead of malloc() in refclock_datum.c (Calysto).
 +* Start using 'design by contract' assertions.
 +* [Bug 767] Fast sync to refclocks wanted.
 +* Allow null driftfile.
 +* Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES.
 +* [Bug 629] changes to ensure broadcast works including on wildcard addresses
 +* [Bug 853] get_node() must return a pointer to maximally-aligned memory.
 +* Initial leap file fixes from Dave Mills.
 +* [Bug 858] Recent leapfile changes broke without OPENSSL.
 +* Use a char for DIR_SEP, not a string.
 +* [Bug 850] driftfile parsing changes.
 +* driftfile maintenance changes from Dave Mills.  Use clock_phi instead of
 +  stats_write_tolerance.
 +* [Bug 828] refid string not being parsed correctly.
 +* [Bug 846] Correct includefile parsing.
 +* [Bug 827] New parsing code does not handle "fudge" correctly.
 +* Enable debugging capability in the config parser.
 +* [Bug 839] Crypto password not read from ntp.conf.
 +* Have autogen produce writable output files.
 +* [Bug 825] Correct logconfig -/+ keyword processing.
 +* [Bug 828] Correct parsing of " delimited strings.
 +* Cleanup FILE * usage after fclose() in ntp_filegen.c.
 +* [Bug 843] Windows Completion port code was incorrectly merged from -stable.
 +* [Bug 841] make deferred binding to local interface the default.
 +  (allows peers/servers to be configured even when no route exists)
 +* [Bug 840] do fudge configuration AFTER peers (thus refclocks) have been
 +  configured.
 +* [Bug 824] Added new parser modules to the Windows project file.
 +* [Bug 832] Add libisc/log.c headers to the distribution.
 +* [Bug 808] Only write the drift file if we are in state 4.
 +* Initial import of libisc/log.c and friends.
 +* [Bug 826] Fix redefinition of PI.
 +* [Bug 825] ntp_scanner.c needs to #include <config.h> .
 +* [Bug 824] New parser code has some build problems with the SIM code.
 +* [Bug 817] Use longnames for setting ntp variables on the command-line;
 +  Allowing '-v' with and without an arg to disambiguate usage is error-prone.
 +* [Bug 822] set progname once, early.
 +* [Bug 819] remove erroneous #if 0 in Windows completion port code.
 +* The new config code missed an #ifdef for building without refclocks.
 +* Distribute some files needed by the new config parsing code.
 +* [Bug 819] Timeout for WaitForMultipleObjects was 500ms instead of INFINITE
 +* Use autogen 5.9.1.
 +* Fix clktest command-line arg processing.'
 +* Audio documentation updates from Dave Mills.
 +* New config file parsing code, from Sachin Kamboj.
 +* fuzz bit cleanup from Dave Mills.
 +* replay cleanup from Dave Mills.
 +* [Bug 542] Tolerate missing directory separator at EO statsdir.
 +* [Bug 812] ntpd should drop supplementary groups.
 +* [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6.
 +* [Bug 740] Fix kernel/daemon startup drift anomaly.
 +* refclock_wwv.c fixes from Dave Mills.
 +* [Bug 810] Fix ntp-keygen documentation.
 +* [Bug 787] Bug fixes for 64-bit time_t on Windows.
 +* [Bug 796] Clean up duplicate #defines in ntp_control.c.
 +* [Bug 569] Use the correct precision for the Leitch CSD-5300.
 +* [Bug 795] Moved declaration of variable to top of function.
 +* [Bug 798] ntpq [p typo crashes ntpq/ntpdc.
 +* [Bug 786] Fix refclock_bancomm.c on Solaris.
 +* [Bug 774] parsesolaris.c does not compile under the new Solaris.
 +* [Bug 782] Remove P() macros from Windows files.
 +* [Bug 778] ntpd fails to lock with drift=+500 when started with drift=-500.
 +* [Bug 592] Trimble Thunderbolt GPS support.
 +* IRIG, CHU, WWV, WWVB refclock improvements from Dave Mills.
 +* [Bug 757] Lose ULONG_CONST().
 +* [Bug 756] Require ANSI C (function prototypes).
 +* codec (audio) and ICOM changes from Dave Mills.
 +
 +---
++
+ * [Bug 959] Refclock on Windows not properly releasing recvbuffs.
+ * [Bug 993] Fix memory leak when fetching system messages.
+ * [Bug 987] Wake up the resolver thread/process when a new interface has
+   become available.
+ * Correctly apply negative-sawtooth for oncore 12 channel receiver.
+ * Startup code for original LinuxPPS removed.  LinuxPPS now conforms to
+   the PPSAPI.
+ * [Bug 1000] allow implicit receive buffer allocation for Windows.
+   fixes startup for windows systems with many interfaces.
+   reduces dropped packets on network bursts.
+   additionally fix timer() starvation during high load.
+ * [Bug 990] drop minimum time restriction for interface update interval.
+ * [Bug 977] Fix mismatching #ifdefs for builds without IPv6.
+ * Update the copyright year.
+ * Build system cleanup (make autogen-generated files writable).
+ * [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI
+   override the standard parameters from the ImagePath registry key.
+ * Fixes for ntpdate:
+ * [Bug 532] nptdate timeout is too long if several servers are supplied.
+ * [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools.
+ * [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't.
+ * [Bug 908] ntpdate crashes sometimes.
+ * [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set
+   (dup of 908).
+ * [Bug 997] ntpdate buffer too small and unsafe.
+ * ntpdate.c: Under Windows check whether NTP port in use under same conditions
+   as under other OSs.
+ * ntpdate.c: Fixed some typos and indents (tabs/spaces).
  (4.2.4p4) Released by Harlan Stenn <stenn@ntp.org>
  
  * [Bug 902] Fix problems with the -6 flag.
diff --cc configure.ac
Simple merge
index 159f97d2641581ebcf7d23f5497d38a1bf8ccf7b,f86034bc3acf1b560ed20f482a5c43c3895833b7..c0f33948c56bcf1f9c2eb3f68f510f58812f8989
@@@ -1,9 -1,9 +1,9 @@@
  /* -*- Mode: Text -*- */
  
  copyright = {
-     date  = "1970-2007";
+     date  = "1970-2008";
      owner = "David L. Mills and/or others";
 -    eaddr = "http://bugs.ntp.isc.org, bugs@ntp.org";
 +    eaddr = "http://bugs.ntp.org, bugs@ntp.org";
      type  = note;
      text  = "see html/copyright.html";
  };
diff --cc include/ntpd.h
Simple merge
Simple merge
diff --cc ntpd/cmd_args.c
Simple merge
index 9a2437017763fef4e32236d202451f3f5935d2b9,13dc599da95f890b4d065cea9e67bb76bebd6e77..4fe5b1eb069658b7bf0b0bbe3c7f963214e24f1c
@@@ -2692,15 -2549,22 +2715,22 @@@ do_resolve_internal(void
                 */
                DWORD dwThreadId;
                fflush(stdout);
+               ResolverEventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
+               if (ResolverEventHandle == NULL) {
+                       msyslog(LOG_ERR, "Unable to create resolver event object, can't start ntp_intres");
+                       abort_resolve();
+               }
                ResolverThreadHandle = CreateThread(
 -                      NULL,                            /* no security attributes      */
 -                      0,                               /* use default stack size      */
 -                      (LPTHREAD_START_ROUTINE) ntp_intres, /* thread function         */
 -                      NULL,                            /* argument to thread function   */
 -                      0,                               /* use default creation flags    */
 -                      &dwThreadId);                    /* returns the thread identifier */
 +                  NULL,                        /* no security attributes      */
 +                  0,                           /* use default stack size      */
 +                  (LPTHREAD_START_ROUTINE) ntp_intres, /* thread function             */
 +                  NULL,                        /* argument to thread function   */
 +                  0,                           /* use default creation flags    */
 +                  &dwThreadId);                /* returns the thread identifier */
                if (ResolverThreadHandle == NULL) {
                        msyslog(LOG_ERR, "CreateThread() failed, can't start ntp_intres");
+                       CloseHandle(ResolverEventHandle);
+                       ResolverEventHandle = NULL;
                        abort_resolve();
                }
        }
Simple merge
diff --cc ntpd/ntp_io.c
Simple merge
diff --cc ntpd/ntpd.c
Simple merge
Simple merge