]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntpdc_ops.c, ChangeLog:
authorBob Dunlop <dunlop@ntp.org>
Sun, 19 Aug 2007 09:26:13 +0000 (05:26 -0400)
committerBob Dunlop <dunlop@ntp.org>
Sun, 19 Aug 2007 09:26:13 +0000 (05:26 -0400)
  [BUG 881] Corrected display of pll offset on 64bit systems.
  [BUG 886] Corrected sign extension of il->compliance on 64 bit systems
  [BUG 878] Avoid ntpdc use of refid value as unterminated string.

bk: 46c80cb5SYY_gsCE9EezPujxLGJPUg

ChangeLog
ntpdc/ntpdc_ops.c

index acb8d3613a9f2b697355e7ea24a0c8a0e08a9a5e..2aef2ca1af453ce4ee2ed2bf7eb773769196262b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+* [Bug 878] Avoid ntpdc use of refid value as unterminated string.
+* [Bug 881] Corrected display of pll offset on 64bit systems.
+* [Bug 886] Corrected sign handling on 64bit in ntpdc loopinfo command.
 * [Bug 889] avoid malloc() interrupted by SIGIO risk
 * ntpd/refclock_parse.c: cleanup shutdown while the file descriptor is still open.
 * [Bug 885] use emalloc() to get a message at the end of the memory
index 20bee3a418577fa11411ae79e4d246dc24a3cbf4..8d6a23c599dd27eb514802954724dfdedac6fdc5 100644 (file)
@@ -886,7 +886,7 @@ again:
                               "offset %s, frequency %s, time_const %ld, watchdog %ld\n",
                               lfptoa(&tempts, 6),
                               lfptoa(&temp2ts, 3),
-                              (u_long)ntohl((u_long)il->compliance),
+                              (long)(int32_t)ntohl((u_long)il->compliance),
                               (u_long)ntohl((u_long)il->watchdog_timer));
        } else {
                NTOHL_FP(&il->last_offset, &tempts);
@@ -896,7 +896,7 @@ again:
                (void) fprintf(fp, "frequency:            %s ppm\n",
                               lfptoa(&tempts, 3));
                (void) fprintf(fp, "poll adjust:          %ld\n",
-                              (u_long)ntohl(il->compliance));
+                              (long)(int32_t)ntohl(il->compliance));
                (void) fprintf(fp, "watchdog timer:       %ld s\n",
                               (u_long)ntohl(il->watchdog_timer));
        }
@@ -2700,7 +2700,6 @@ clockstat(
        int res;
        l_fp ts;
        struct clktype *clk;
-       u_long ltemp;
 
        for (qitems = 0; qitems < min(pcmd->nargs, 8); qitems++)
            clist[qitems] = GET_INADDR(pcmd->argval[qitems].netnum);
@@ -2758,9 +2757,8 @@ again:
                               lfptoa(&ts, 6));
                (void) fprintf(fp, "stratum:              %ld\n",
                               (u_long)ntohl(cl->fudgeval1));
-               ltemp = ntohl(cl->fudgeval2);
                (void) fprintf(fp, "reference ID:         %s\n",
-                              (char *)&ltemp);
+                              refid_string(ntohl(cl->fudgeval2), 0));
                (void) fprintf(fp, "fudge flags:          0x%x\n",
                               cl->flags);
 
@@ -2992,7 +2990,7 @@ again:
                tscale = 1e-9;
 #endif
        (void)fprintf(fp, "pll offset:           %g s\n",
-           (long)ntohl(ik->offset) * tscale);
+           (int32_t)ntohl(ik->offset) * tscale);
        (void)fprintf(fp, "pll frequency:        %s ppm\n",
            fptoa((s_fp)ntohl(ik->freq), 3));
        (void)fprintf(fp, "maximum error:        %g s\n",