Handle zero NTP timestamp in UTI_Ntp64ToTimespec() as a special value to
make it symmetric with UTI_TimespecToNtp64(). This is needed since
commit
d75f6830f190037421a66754849571fd0b495e35, in which a timestamp is
converted back and forth without checking for zero.
It also makes zero NTP timestamps more apparent in debug output.
{
uint32_t ntp_sec, ntp_frac;
- /* As yet, there is no need to check for zero - all processing that
- has to detect that case is in the NTP layer */
+ /* Zero is a special value */
+ if (UTI_IsZeroNtp64(src)) {
+ UTI_ZeroTimespec(dest);
+ return;
+ }
ntp_sec = ntohl(src->hi);
ntp_frac = ntohl(src->lo);