[Git][NTPsec/ntpsec][master] fix #816 to add variety to System Status Word...
Hal Murray (@hal.murray)
gitlab at mg.gitlab.com
Fri Feb 7 10:09:11 UTC 2025
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
b982ae4e by James Browning at 2025-02-07T10:05:53+00:00
fix #816 to add variety to System Status Word...
That should not always be sync_unspec, so we should default
to CTL_SST_TS_UNSPEC unless we have a system peer.
- If the peer is a refclock, use its sstclktype.
- Otherwise, we have a CTL_SST_TS_NTP.
- - - - -
1 changed file:
- ntpd/ntp_control.c
Changes:
=====================================
ntpd/ntp_control.c
=====================================
@@ -1003,18 +1003,17 @@ ctlclkstatus(
static unsigned short
ctlsysstatus(void)
{
- uint8_t this_clock;
+ uint8_t this_clock = CTL_SST_TS_UNSPEC;
- this_clock = CTL_SST_TS_UNSPEC;
+ if (NULL == sys_vars.sys_peer) {
#ifdef REFCLOCK
- if (sys_vars.sys_peer != NULL) {
- if (CTL_SST_TS_UNSPEC != sys_vars.sys_peer->sstclktype)
- this_clock = sys_vars.sys_peer->sstclktype;
- }
-#else /* REFCLOCK */
- if (sys_vars.sys_peer != 0)
+ } else if (CTL_SST_TS_UNSPEC != sys_vars.sys_peer->sstclktype) {
+ this_clock = sys_vars.sys_peer->sstclktype;
+#endif // REFCLOCK
+ } else {
this_clock = CTL_SST_TS_NTP;
-#endif /* REFCLOCK */
+ }
+
return CTL_SYS_STATUS(sys_vars.sys_leap, this_clock, ctl_sys_num_events,
ctl_sys_last_event);
}
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/b982ae4e83040c636cd21c25a830204a21b5c235
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/b982ae4e83040c636cd21c25a830204a21b5c235
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/20250207/692e421f/attachment-0001.htm>
More information about the vc
mailing list