Hi,
I'm seeing stuff like this:

chronyc> tracking
Reference ID    : 10.20.30.40 (10.20.30.40)
Stratum         : 4
Ref time (UTC)  : Thu Apr 13 14:39:49 2006
System time     : 4294967291.354725 seconds slow of NTP time
Frequency       : 12.108 ppm fast
Residual freq   : -0.000 ppm
Skew            : 35.473 ppm
Root delay      : 0.058060 seconds
Root dispersion : 0.030106 seconds

This is known as Debian bug #195620, which is almost three years old!

The problem is that a uint32_t which comes out of ntohl() (but
actually represents a signed value) is directly promoted to long.
Therefore no sign extension takes place.

Patch below solves the problem. There are other places where this
needs to be fixed, but I'll leave that to a less lazy person.

Cheers,

Eric


--- /home/eric/.backup/client.c~        2006-04-13 14:47:38.000000000 +0000
+++ chrony-1.21/client.c        2006-04-13 14:47:38.000000000 +0000
@@ -1652,7 +1652,7 @@
     ref_time.tv_usec = ntohl(reply.data.tracking.ref_time_us);
     ref_time_tm = *gmtime((time_t *)&ref_time.tv_sec);
     printf("Ref time (UTC)  : %s", asctime(&ref_time_tm));
-    correction_tv.tv_sec = ntohl(reply.data.tracking.current_correction_s);
+    correction_tv.tv_sec = 
(int32_t)ntohl(reply.data.tracking.current_correction_s);
     correction_tv.tv_usec = ntohl(reply.data.tracking.current_correction_us);
     correction = (double) correction_tv.tv_sec + 1.0e-6 * 
correction_tv.tv_usec;
     printf("System time     : %.6f seconds %s of NTP time\n", fabs(correction),


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to