From eac3c62b5190d7dbc0ab017b908d2c94bec366c2 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 25 Jun 2003 20:56:40 +0000 Subject: [PATCH] During a positive leap second, the tai_time offset should be incremented at the start of the leap second, not after the leap second has been inserted. This is because at the start of the leap second, we set the time back one second. This setting back one second is the moment that the offset changes. The old code set it back after the leap second, but that's one second too late. The negative leap second case is handled correctly. Reviewed by: phk --- sys/kern/kern_ntptime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 6490cbd0b58..8bf109b8ba9 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -480,6 +480,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) else if ((*newsec) % 86400 == 0) { (*newsec)--; time_state = TIME_OOP; + time_tai++; } break; @@ -500,7 +501,6 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) * Insert second in progress. */ case TIME_OOP: - time_tai++; time_state = TIME_WAIT; break;