]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
authorDave Hart <hart@ntp.org>
Sun, 11 Mar 2012 07:10:54 +0000 (07:10 +0000)
committerDave Hart <hart@ntp.org>
Sun, 11 Mar 2012 07:10:54 +0000 (07:10 +0000)
bk: 4f5c4ffekezHkt9-OZ3J1RtkReJ1-w

ChangeLog
include/ntp_stdlib.h
ntpd/ntp_timer.c
ports/winnt/ntpd/nt_clockstuff.c

index 29b6f552c12f74823e4b3898468fc551e0957300..835d423997646fba7fc49c46e4cc32adebae9a4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 * [Bug 2156] clock instability with LOCAL driver, from Miroslav Lichvar.
+* [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
 (4.2.7p262) 2012/02/29 Released by Harlan Stenn <stenn@ntp.org>
 * Improve ntpd scalability for servers with many trusted keys.
 (4.2.7p261) 2012/02/27 Released by Harlan Stenn <stenn@ntp.org>
index 0640dae2decd19c89c0d3ec667161393a5d5e89a..4f31c9d3a63ae875c52d54e9c6086fc554962e01 100644 (file)
@@ -77,6 +77,10 @@ extern       void    errno_to_str(int, char *, size_t);
                errno = preserved_errno;                \
        }
 
+#define MINUTE 60
+#define HOUR   (60 * MINUTE)
+#define        DAY     (24 * HOUR)
+
 typedef void (*ctrl_c_fn)(void);
 
 /* authkeys.c */
index 1afd12eebc5824f9b1abdeb663ce80f69b8dbc6e..c853aac9affbb62a5d068a02cd264f7ab138922a 100644 (file)
@@ -78,10 +78,6 @@ u_long       sys_automax = NTP_AUTOMAX; /* key list timeout (log2 s) */
  */
 volatile u_long alarm_overflow;
 
-#define MINUTE 60
-#define HOUR   (60 * MINUTE)
-#define        DAY     (24 * HOUR)
-
 u_long current_time;           /* seconds since startup */
 
 /*
index 1e1efd7fdf61afc4c67e7d22bbfb43cb32a03535..f52d0e1fb2a30f177ffb609b69b8728e54cccfc4 100644 (file)
@@ -472,10 +472,11 @@ adj_systime(
 
 
        /*
-        * If a leap second is pending then determine the UTC time stamp 
-        * of when the insertion must take place 
+        * If a leap second is pending for the end of the month,
+        * determine the UTC time stamp when the insertion must take
+        * place 
         */
-       if (leapsec > 0) {
+       if (0 < leapsec && leapsec < 31 * DAY) {
                if (0 == ls_ft.ull) {  /* time stamp has not yet been computed */
                        GetSystemTime(&st);