better test for NTP3 servers
Issue #897
new
In the server response payload, it is not sufficient to test for NTP_LEAP_NOTSYNC.
A stronger check is to compare the server timestamp with a valid, past datetime: if the timestamp is smaller, it is not valid.
The attached file add this check, using as value 1 jan 1970.
Comments (1)
-
repo owner - Log in to comment
Thanks for patch Massimo.
I have looked on it, i see few problems:
3. The value of 1 jan 1970 is 0 … what’s the point testing the reference timestamp with 2208988800U (01/01/2040 @ 12:00am UTC)? The 2208988800U is 5 bytes btw. but you compare it with uint32_t (4 bytes)