NTPClient icon indicating copy to clipboard operation
NTPClient copied to clipboard

Adding Validity-Checks for incoming packets

Open CJuette opened this issue 8 years ago • 2 comments
trafficstars

Using the Library with Wifi I experienced some problems with timestamps occasionally being way off, by that I mean more than 1,000,000,000 s off.

After some investigation I discovered that the board had captured some other UDP-Packets and had interpreted them as NTP-Packets. Somehow the application PowerFolder had sent them to Port 1337 of the board (why that is is another problem).

However I decided to implement a few validity checks before actually interpreting the packets as NTP-Packets. Feel free to edit my implementation. I implemented a method "isValid()" which gets called in "forceUpdate".

CJuette avatar Apr 11 '17 15:04 CJuette

I have the same problem, sometimes I get 2036-02-07 07:28:... as the current time, which means secsSince1900 is all zeroes. this->_udp->read(this->_packetBuffer, NTP_PACKET_SIZE) call in forceUpdate() should be checked to if it returns NTP_PACKET_SIZE.

mmmilan avatar Sep 02 '19 11:09 mmmilan

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Chritzel seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 09 '21 13:04 CLAassistant