Fix a sign error in conversion of HW time to local time, which caused
the jitter to be amplified instead of reduced. NTP with HW timestamping
should now be more stable and able to ignore occasionally delayed
readings of PHC.
return 0;
elapsed = UTI_DiffTimespecsToDouble(raw, &clock->hw_ref);
- offset = clock->offset + elapsed / clock->frequency;
+ offset = elapsed / clock->frequency - clock->offset;
UTI_AddDoubleToTimespec(&clock->local_ref, offset, cooked);
/* Fow now, just return the error of the last sample */