Skip to content

Commit cb073ba

Browse files
committed
Remove time fraction check from isValid()
1 parent cbf3bf8 commit cb073ba

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

NTPClient.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ static bool isValid(byte const *ntpPacket)
8989
unsigned long highWord = word(ntpPacket[16], ntpPacket[17]);
9090
unsigned long lowWord = word(ntpPacket[18], ntpPacket[19]);
9191
unsigned long refTimeInt = highWord << 16 | lowWord;
92-
highWord = word(ntpPacket[20], ntpPacket[21]);
93-
lowWord = word(ntpPacket[22], ntpPacket[23]);
94-
unsigned long refTimeFrac = highWord << 16 | lowWord;
9592

9693
byte leapIndicator = ((ntpPacket[0] & 0b11000000) >> 6);
9794
byte version = ((ntpPacket[0] & 0b00111000) >> 3);
@@ -105,8 +102,7 @@ static bool isValid(byte const *ntpPacket)
105102
((mode == 4) || (mode == 5)) && // Mode == server or broadcast
106103
(stratum >= 1) &&
107104
(stratum <= 15) &&
108-
(refTimeInt != 0) &&
109-
(refTimeFrac != 0)
105+
(refTimeInt != 0)
110106
);
111107
}
112108

0 commit comments

Comments
 (0)