NTPClient icon indicating copy to clipboard operation
NTPClient copied to clipboard

Add packet validity checks

Open bmcdonnell opened this issue 3 years ago • 5 comments

Addresses #133. Improves upon #28 (not merged).

bmcdonnell avatar May 23 '21 17:05 bmcdonnell

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 23 '21 17:05 CLAassistant

Memory usage change @ cb073babecbc55eb10100a87824e339a5ce5db4e

Board flash % RAM for global variables %
esp8266:esp8266:huzzah :small_red_triangle: +112 - +112 +0.01 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Advanced
flash
% examples/Advanced
RAM for global variables
% examples/Basic
flash
% examples/Basic
RAM for global variables
%
esp8266:esp8266:huzzah 112 0.01 0 0.0 112 0.01 0 0.0
Click for full report CSV
Board,examples/Advanced<br>flash,%,examples/Advanced<br>RAM for global variables,%,examples/Basic<br>flash,%,examples/Basic<br>RAM for global variables,%
esp8266:esp8266:huzzah,112,0.01,0,0.0,112,0.01,0,0.0

github-actions[bot] avatar May 23 '21 19:05 github-actions[bot]

I added a check of the fractional part of the reference time, since per RFC4330,

There will exist a 232-picosecond interval, henceforth ignored, every 136 years when the 64-bit field will be 0, which by convention is interpreted as an invalid or unavailable timestamp.

This time does roll over, so it can hit zero again. The reference time isn't updated frequently - it's not always getting updated in subsequent queries like the other timestamps - so this force push covers a very rare but still conceivable corner case (vs the previous revision).

bmcdonnell avatar May 24 '21 01:05 bmcdonnell

Marked as draft because I'm getting some NTP version 3 responses, which this was rejecting.

bmcdonnell avatar May 24 '21 01:05 bmcdonnell

Memory usage change @ 38a7dffd324d3695b334ddc59cbaa8680b124ee0

Board flash % RAM for global variables %
esp8266:esp8266:huzzah :small_red_triangle: +160 - +160 +0.02 - +0.02 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Advanced
flash
% examples/Advanced
RAM for global variables
% examples/Basic
flash
% examples/Basic
RAM for global variables
%
esp8266:esp8266:huzzah 160 0.02 0 0.0 160 0.02 0 0.0
Click for full report CSV
Board,examples/Advanced<br>flash,%,examples/Advanced<br>RAM for global variables,%,examples/Basic<br>flash,%,examples/Basic<br>RAM for global variables,%
esp8266:esp8266:huzzah,160,0.02,0,0.0,160,0.02,0,0.0

github-actions[bot] avatar May 24 '21 02:05 github-actions[bot]