diff --git a/timesource/timesource.go b/timesource/timesource.go index 2e951faba..8705818d8 100644 --- a/timesource/timesource.go +++ b/timesource/timesource.go @@ -73,6 +73,9 @@ func computeOffset(timeQuery ntpQuery, servers []string, allowedFailures int) (t response, err := timeQuery(server, ntp.QueryOptions{ Timeout: DefaultRPCTimeout, }) + if err == nil { + err = response.Validate() + } if err != nil { responses <- queryResponse{Error: err} return diff --git a/timesource/timesource_test.go b/timesource/timesource_test.go index 9b3744968..0c38851d8 100644 --- a/timesource/timesource_test.go +++ b/timesource/timesource_test.go @@ -39,7 +39,10 @@ func (tc *testCase) query(string, ntp.QueryOptions) (*ntp.Response, error) { tc.actualAttempts++ tc.mu.Unlock() }() - response := &ntp.Response{ClockOffset: tc.responses[tc.actualAttempts].Offset} + response := &ntp.Response{ + ClockOffset: tc.responses[tc.actualAttempts].Offset, + Stratum: 1, + } return response, tc.responses[tc.actualAttempts].Error }