Skip to content

Adding Validity-Checks for incoming packets #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CJuette
Copy link

@CJuette CJuette commented Apr 11, 2017

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".

@mmmilan
Copy link

mmmilan commented Sep 2, 2019

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.

@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

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.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants