Package: chrony
Version: 1.21z-5
Followup-For: Bug #348412
Hi,
the problem seems to originate from the fact that time_t is 64bit. The
tracking source sends an int32_t that gets converted with ntohl making
it an uint32_t and then gets assigned to a time_t making it
int64_t.
Casting to int32_t restores the sign bit before expanding to 64bit.
MfG
Goswin
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19.2-xen-3.0.4-1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages chrony depends on:
ii libc6 2.3.6.ds1-10 GNU C Library: Shared libraries
ii libncurses5 5.5-5 Shared libraries for terminal hand
ii libreadline5 5.2-2 GNU readline and history libraries
ii ucf 2.0018.1 Update Configuration File: preserv
chrony recommends no packages.
-- no debconf information
diff -u chrony-1.21z/client.c chrony-1.21z/client.c
--- chrony-1.21z/client.c
+++ chrony-1.21z/client.c
@@ -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),
diff -u chrony-1.21z/debian/changelog chrony-1.21z/debian/changelog
--- chrony-1.21z/debian/changelog
+++ chrony-1.21z/debian/changelog
@@ -1,3 +1,9 @@
+chrony (1.21z-5a0.mrvn.1) unstable; urgency=low
+
+ * Fix for 64bit time_t.
+
+ -- Goswin von Brederlow <[EMAIL PROTECTED]> Mon, 29 Jan 2007 11:18:58 +0100
+
chrony (1.21z-5) unstable; urgency=high
* Applied postinst patch from Lionel Elie Mamane to test for the