[ntp:hackers] Leap seconds: fine print on peer.leap
Hal Murray
hmurray at megapathdsl.net
Sun Nov 16 03:36:35 UTC 2008
I'm chasing a leap second glitch. GPS satellites are now announcing that a
leap second is pending. I haven't tracked that the fine print, but I think
they say it happens at the end of next December.
I've got a HP Z3801A. It's currently reporting that a leap second is pending
but the normal packet format doesn't say when. There is a special command to
ask when, but the driver doesn't use it. The refclock driver just sets the
leap pending bits and at the end of the month, the system will go through the
leap second dance.
I've gone through a couple of bogus leap seconds already. I'd like to fix
the bug by the end of this month. I've only got one test case left.
The RFCs all say end of the current day, but they aren't describing this
interface. (peer.leap)
ntp.h says:
#define LEAP_ADDSECOND 0x1 /* last minute of day has 61 seconds */
#define LEAP_DELSECOND 0x2 /* last minute of day has 59 seconds */
I suspect it means at the end of the current month, at least when used with
peer.leap.
clock_update in ntp_proto.c says:
* If a leap warning bit is found on a reference clock, the vote
* is always won.
* If the leapseconds values are from file or network
* and the leap is in the future, schedule a leap at the
* given epoch. Otherwise, if the number of survivor
* leap bits is greater than half the number of
* survivors, schedule a leap for the end of the current
* month.
The WWVB and ACTS drivers get current-month because NIST doesn't turn on the
leap-second flag until the appropriate month. I don't see any code that
waits until the last day of the month before passing on the announcement.
The oncore driver has this comment:
/* Only raise warning within a month of the leap second */
I think the code matches that.
I think I should add a similar check to the HP driver, but I'd like
confirmation and/or correction.
Do any other drivers have similar problems?
--
These are my opinions, not necessarily my employer's. I hate spam.
More information about the hackers
mailing list