Skip to content

Commit

Permalink
Remove time fraction check from isValid()
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcdonnell committed May 23, 2021
1 parent cbf3bf8 commit cb073ba
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions NTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ static bool isValid(byte const *ntpPacket)
unsigned long highWord = word(ntpPacket[16], ntpPacket[17]);
unsigned long lowWord = word(ntpPacket[18], ntpPacket[19]);
unsigned long refTimeInt = highWord << 16 | lowWord;
highWord = word(ntpPacket[20], ntpPacket[21]);
lowWord = word(ntpPacket[22], ntpPacket[23]);
unsigned long refTimeFrac = highWord << 16 | lowWord;

byte leapIndicator = ((ntpPacket[0] & 0b11000000) >> 6);
byte version = ((ntpPacket[0] & 0b00111000) >> 3);
Expand All @@ -105,8 +102,7 @@ static bool isValid(byte const *ntpPacket)
((mode == 4) || (mode == 5)) && // Mode == server or broadcast
(stratum >= 1) &&
(stratum <= 15) &&
(refTimeInt != 0) &&
(refTimeFrac != 0)
(refTimeInt != 0)
);
}

Expand Down

0 comments on commit cb073ba

Please sign in to comment.