[Git][NTPsec/ntpsec][master] Simpler version of autonomy code - avoid CLOSETIME clipping.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Aug 31 13:05:27 UTC 2017


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


Commits:
5489ed5a by Eric S. Raymond at 2017-08-31T09:01:39-04:00
Simpler version of autonomy code - avoid CLOSETIME clipping.

- - - - -


1 changed file:

- libntp/clocktime.c


Changes:

=====================================
libntp/clocktime.c
=====================================
--- a/libntp/clocktime.c
+++ b/libntp/clocktime.c
@@ -80,12 +80,19 @@ clocktime(
 	 * Year > 1970 - from a 4-digit year stamp, must be greater
 	 * than POSIX epoch. Means we're not dependent on the pivot
 	 * value (derived from the packet receipt timestamp, and thus
-	 * ultimately from the system clock) to be correct.  These
-	 * two lines thus make it possible to recover from a trashed
-	 * or zeroed system clock.
+	 * ultimately from the system clock) to be correct. CLOSETIME
+	 * clipping to the receive time will *not* be applied in this
+	 * case. These two lines thus make it possible to recover from
+	 * a trashed or zeroed system clock.
+	 *
+	 * Warning: the hack in the NMEA driver that rectifies 4-digit
+	 * yearts from 2-digit ones has an expiration date in 2399.
+	 * After that this code will go badly wrong.
 	 */
-	if (year > 1970)
+	if (year > 1970) {
 	    *yearstart = year_to_ntp(year);
+	    return  *yearstart + tmp;
+	}
 
         /*
 	 * Year was too small to make sense, probably from a 2-digit



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/5489ed5a593c8e14138e47544a1598d4c6576dee

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/5489ed5a593c8e14138e47544a1598d4c6576dee
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/20170831/dd40a9da/attachment.html>


More information about the vc mailing list