[Git][NTPsec/ntpsec][master] Allow "prefer" on a "pps" peer to use it
Eric S. Raymond
gitlab at mg.gitlab.com
Mon Jan 21 11:29:07 UTC 2019
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
af0827f6 by Eric S. Raymond at 2019-01-21T11:26:07Z
Allow "prefer" on a "pps" peer to use it
This change allows "prefer" on a "pps" peer to indicate that the PPS
input should be used with any source.
The documentation, prior to Richard Lagger's recent cleanup, listed
this as an option, but it did not exist in the code:
"3. If there is a PPS driver and the system clock offset at this point
is less than 0.4 s, and if there is a prefer peer among the survivors
or if the PPS peer is designated as a prefer peer, the PPS driver
becomes the system peer"
Note the option of "if the PPS peer is designated as a prefer peer".
This adds that functionality, which is useful if you want to use the
PPS input with any source. The typical example here would be that you
want to use network sources to number the seconds. Without this
change, you have to mark one as a prefer peer, and the PPS is only
used if that particular peer is selected. This has a couple
problems. First, if that peer goes down, the PPS stops being
used. Second, marking a particular network peer as a prefer peer gives
it special status in the clock selection algorithm, which may not be
desirable.
This resolves GitLab issue #538. It's a merge by hand of an MR
by Richard Laager.
- - - - -
2 changed files:
- docs/prefer.adoc
- ntpd/ntp_proto.c
Changes:
=====================================
docs/prefer.adoc
=====================================
@@ -239,9 +239,12 @@ is less than 0.4 s, that PPS driver becomes the system peer and its
offset and jitter are inherited by the system variables, thus overriding
any values already computed. However, if the PPS driver is specifically
the link:driver_pps.html[driver named "pps"], which must be used with
-another driver, then there must be a prefer peer among the survivors, as
-the +prefer+ keyword is used to identify the source associated with the
-PPS input. For an exception, see the +minsane+ option below.
+another driver, additional rules apply. In one mode of operation, there
+must be a prefer peer among the survivors, as the +prefer+ keyword is
+used to identify the source associated with the PPS input. To indicate
+that the PPS input should be used with any source(s), the pps peer
+itself must be marked with the +prefer+ keyword. For an exception, see
+the +minsane+ option below.
If none of the above is the case, the data are disregarded and the
system variables remain as they are.
=====================================
ntpd/ntp_proto.c
=====================================
@@ -1925,6 +1925,7 @@ clock_select(void)
if (typepps != NULL && fabs(sys_offset) < 0.4 &&
(!typepps->is_pps_driver ||
sys_prefer != NULL ||
+ (typesystem != NULL && typepps->cfg.flags & FLAG_PREFER) ||
(typesystem == NULL && sys_minsane == 0))) {
typesystem = typepps;
sys_clockhop = 0;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/af0827f6b48c2d22e644762b63180b354c3817fe
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/af0827f6b48c2d22e644762b63180b354c3817fe
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190121/d347af12/attachment-0001.html>
More information about the vc
mailing list