Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Oct 2015 17:44:35 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        Ian Lepore <ian@freebsd.org>, Cy Schubert <cy@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r289421 - in head/etc: . mtree ntp
Message-ID:  <00150EF2-0020-42E5-A1E5-324A23975577@bsdimp.com>
In-Reply-To: <20151017212033.GA43955@walton.maths.tcd.ie>
References:  <201510161404.t9GE4GqM046436@repo.freebsd.org> <1445106350.71631.36.camel@freebsd.org> <20151017212033.GA43955@walton.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_E8A0F81E-2334-4E56-9521-4574B2EC9B16
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Oct 17, 2015, at 3:20 PM, David Malone <dwmalone@maths.tcd.ie> =
wrote:
>=20
> On Sat, Oct 17, 2015 at 12:25:50PM -0600, Ian Lepore wrote:
>>    If the leapseconds file is present, the leap bits for reference
>>    clocks and downstratum servers are ignored.
>>=20
>> I can't determine from casual code examination (and I don't have time
>> to experiment now) whether that is true even if the file is expired.
>=20
> The way the code seems to work is:
>=20
> 	1) Take a vote from your peers on if there is an upcoming
> 	leap second. Refclocks can outvote other peers. (This is
> 	in ntp_proto.c:clock_update() - search for leap_vote_ins).

Assuming no bugs, yes. And assuming your peers are sending
the correct information. History with ntpd and ntp serves well
illustrates that these assumptions are violated often.

> 	2) If one seems to be pending, try to insert it into an
> 	in-memory table for the end of the month.

NTP only recognizes June and December as valid leap insertion
points. This is likely safe for the foreseeable future though, even
though the official standard allows leap seconds to be the end of
any month. Too many things assume you only have leap seconds
at these times for IERS to issue one that isn=E2=80=99t at the end of =
December
or June until earth rotation forces their hand sometime around the
end of this century (give or take a few decades).

> 	3) If you find that you loaded a table and the leapsecond
> 	you are trying to insert is within the valid range of the
> 	table, return an error. (This is in ntp_leapsec.c:leapsec_add())
>=20
> So, I think the change should be safe, if the comments match the code.

That=E2=80=99s a big if. Both Ian and I have witnessed the carnage of =
incorrect
leap seconds first hand and so are somewhat touchy on the subject. It
is a place where getting the canonical information is 1000x better than
relying on code to implement things that can=E2=80=99t go wrong. Because =
they
often do. Way way too often. When you have leap second info, always
always always try extra hard to make sure it is as up to date as you
can get it. Any =E2=80=9Cshort cut=E2=80=9D here is asking for trouble, =
even if you think
you can prove that no such trouble is possible.

Warner


--Apple-Mail=_E8A0F81E-2334-4E56-9521-4574B2EC9B16
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJWIt1kAAoJEGwc0Sh9sBEAPSQQAOurNfBul18bw00iYpASv/gl
lDWhyF77yd0XI7EugmZBF+jYr0jHMWlIW7ViP2qBx01aN9C3Axwz2UKzG5qZBkKl
rMAsbEw7xcySbWrSu/4EtDLetr0tkXImSjon1eNpnwdrQPeklku5n+3gXJis+YF/
vG1JTc6GpoJez0HWk/DREpDwtUz3y8bHrzSPmIXcvm9OhzUDnChv2wiIZqbrK0qk
wJYxkdw8rVCb8oiPMvWRlwLW7LbjzD2PkpTBlnxW1BIbXhmwslVmuYXQTXWk4fnF
6EACndACuhkIsxrfUmqrjIYqIdqAxm6YbCq0bnVv1Y+7ov1yUyk3vr57xVmrkPi7
WwbNejohjkgs0mquCp9MOvI5Z5N4kqd3/Fmh7qL51ousc5k8cZVKcF7q2sla6ahe
w62+jX3mW/gtOP1hTpSnyybMHZZaxpVFzJy1tUKZF6OJF3kc4334/l1u/7b/UKvj
JF5ubNkj3Rrpm3vrZVJMPZO/LTBONRsH1WItSWsQWhuX4hpXa0Po2vsnz+DFQTc8
kMO5+d3gYjsks3gGptxa3a6Y7GaXMiE5XmUfZ9AwvjjWdrK2+avUWitjrgGVAcqM
EvQbSRuIIuJlP34b1hik9uDsRi+3ba4BtHre6ixSWJ9mhBETMS6Iav1n/yXpVqfM
4qyaGJ8BzskZr3euEYbm
=fuAx
-----END PGP SIGNATURE-----

--Apple-Mail=_E8A0F81E-2334-4E56-9521-4574B2EC9B16--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00150EF2-0020-42E5-A1E5-324A23975577>