]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: ignore zero HW timestamps
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 5 Jan 2017 14:37:34 +0000 (15:37 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 6 Jan 2017 12:12:19 +0000 (13:12 +0100)
Apparently, zero HW timestamps are possible with buggy drivers/HW.

ntp_io_linux.c

index 8d0eea92a4f670a33c098a369bd0e1e445ffde08..9dcbd4a7b8a9c11c55dded73eaeeac04fc11d3ab 100644 (file)
@@ -536,7 +536,7 @@ NIO_Linux_ProcessMessage(NTP_Remote_Address *remote_addr, NTP_Local_Address *loc
       if (!UTI_IsZeroTimespec(&ts3.ts[0])) {
         LCL_CookTime(&ts3.ts[0], &local_ts->ts, &local_ts->err);
         local_ts->source = NTP_TS_KERNEL;
-      } else {
+      } else if (!UTI_IsZeroTimespec(&ts3.ts[2])) {
         iface = get_interface(if_index);
         if (iface) {
           process_hw_timestamp(iface, &ts3.ts[2], local_ts, !is_tx ? length : 0,