[Git][NTPsec/ntpsec][master] 2 commits: Information hiding.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Nov 10 19:54:23 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
5b641405 by Eric S. Raymond at 2016-11-10T13:46:46-05:00
Information hiding.

- - - - -
0d479d93 by Eric S. Raymond at 2016-11-10T14:54:01-05:00
More information hiding.

- - - - -


3 changed files:

- include/ntp_stdlib.h
- libntp/systime.c
- ntpd/ntp_proto.c


Changes:

=====================================
include/ntp_stdlib.h
=====================================
--- a/include/ntp_stdlib.h
+++ b/include/ntp_stdlib.h
@@ -239,9 +239,11 @@ extern	size_t	strlcpy(char *dst, const char *src, size_t siz);
 extern	size_t	strlcat(char *dst, const char *src, size_t siz);
 #endif
 
+/* ntp_proto.c */
+extern double	measured_tick;		/* non-overridable sys_tick */
+
 /* systime.c */
 extern double	sys_tick;		/* tick size or time to read */
-extern double	measured_tick;		/* non-overridable sys_tick */
 extern double	sys_fuzz;		/* min clock read latency */
 extern bool	trunc_os_clock;		/* sys_tick > measured_tick */
 


=====================================
libntp/systime.c
=====================================
--- a/libntp/systime.c
+++ b/libntp/systime.c
@@ -57,16 +57,19 @@
  * input.  The remaining correction sys_residual is carried into the
  * next adjtime() and meanwhile is also factored into get_systime()
  * readings.
+ *
+ * adj_systime() and step_systime() will behave sanely with these
+ * variables not set, but the adjustments may be in larger steps.
  */
 double	sys_tick = 0;		/* tick size or time to read (s) */
 double	sys_fuzz = 0;		/* min. time to read the clock (s) */
-long	sys_fuzz_nsec = 0;	/* min. time to read the clock (ns) */
-double	measured_tick;		/* non-overridable sys_tick (s) */
-double	sys_residual = 0;	/* adjustment residue (s) */
 bool	trunc_os_clock;		/* sys_tick > measured_tick */
 time_stepped_callback	step_callback;
 
-/* perlinger at ntp.org: As 'get_sysime()' does its own check for clock
+static double	sys_residual = 0;	/* adjustment residue (s) */
+static long	sys_fuzz_nsec = 0;	/* min. time to read the clock (ns) */
+
+/* perlinger at ntp.org: As 'get_systime()' does its own check for clock
  * backstepping, this could probably become a local variable in
  * 'get_systime()' and the cruft associated with communicating via a
  * static value could be removed after the v4.2.8 release.


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -123,6 +123,8 @@ u_long	sys_limitrejected;	/* rate exceeded */
 u_long	sys_kodsent;		/* KoD sent */
 u_long	use_stattime;		/* elapsed time since reset */
 
+double	measured_tick;		/* non-overridable sys_tick (s) */
+
 static	double	root_distance	(struct peer *);
 static	void	clock_combine	(peer_select *, int, int);
 static	void	peer_xmit	(struct peer *);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/e138955ca1bd5523f0cb6c4b62ea2b97204a48ba...0d479d93c21e23cff9b5201aae1c44b5eb5141f7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161110/3496ea51/attachment.html>


More information about the vc mailing list