aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp/ntpdc/ntpdc_ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/ntpdc/ntpdc_ops.c')
-rw-r--r--contrib/ntp/ntpdc/ntpdc_ops.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/contrib/ntp/ntpdc/ntpdc_ops.c b/contrib/ntp/ntpdc/ntpdc_ops.c
index 586ed7f05882..3b50916e7f8a 100644
--- a/contrib/ntp/ntpdc/ntpdc_ops.c
+++ b/contrib/ntp/ntpdc/ntpdc_ops.c
@@ -2713,8 +2713,17 @@ again:
lfptoa(&ts, 6));
(void) fprintf(fp, "stratum: %ld\n",
(u_long)ntohl(cl->fudgeval1));
+ /* [Bug3527] Backward Incompatible: cl->fudgeval2 is
+ * a string, instantiated via memcpy() so there is no
+ * endian issue to correct.
+ */
+#ifdef DISABLE_BUG3527_FIX
(void) fprintf(fp, "reference ID: %s\n",
refid_string(ntohl(cl->fudgeval2), 0));
+#else
+ (void) fprintf(fp, "reference ID: %s\n",
+ refid_string(cl->fudgeval2, 0));
+#endif
(void) fprintf(fp, "fudge flags: 0x%x\n",
cl->flags);
@@ -2920,7 +2929,7 @@ kerninfo(
size_t itemsize;
int res;
unsigned status;
- double tscale = 1e-6;
+ double tscale_usec = 1e-6, tscale_unano = 1e-6;
again:
res = doquery(impl_ver, REQ_GET_KERNEL, 0, 0, 0, (char *)NULL,
@@ -2945,16 +2954,16 @@ again:
*/
#ifdef STA_NANO
if (status & STA_NANO)
- tscale = 1e-9;
+ tscale_unano = 1e-9;
#endif
(void)fprintf(fp, "pll offset: %g s\n",
- (int32)ntohl(ik->offset) * tscale);
+ (int32)ntohl(ik->offset) * tscale_unano);
(void)fprintf(fp, "pll frequency: %s ppm\n",
fptoa((s_fp)ntohl(ik->freq), 3));
(void)fprintf(fp, "maximum error: %g s\n",
- (u_long)ntohl(ik->maxerror) * tscale);
+ (u_long)ntohl(ik->maxerror) * tscale_usec);
(void)fprintf(fp, "estimated error: %g s\n",
- (u_long)ntohl(ik->esterror) * tscale);
+ (u_long)ntohl(ik->esterror) * tscale_usec);
(void)fprintf(fp, "status: %04x ", status);
#ifdef STA_PLL
if (status & STA_PLL) (void)fprintf(fp, " pll");
@@ -3008,7 +3017,7 @@ again:
(void)fprintf(fp, "pll time constant: %ld\n",
(u_long)ntohl(ik->constant));
(void)fprintf(fp, "precision: %g s\n",
- (u_long)ntohl(ik->precision) * tscale);
+ (u_long)ntohl(ik->precision) * tscale_usec);
(void)fprintf(fp, "frequency tolerance: %s ppm\n",
fptoa((s_fp)ntohl(ik->tolerance), 0));
@@ -3027,7 +3036,7 @@ again:
(void)fprintf(fp, "pps stability: %s ppm\n",
fptoa((s_fp)ntohl(ik->stabil), 3));
(void)fprintf(fp, "pps jitter: %g s\n",
- (u_long)ntohl(ik->jitter) * tscale);
+ (u_long)ntohl(ik->jitter) * tscale_unano);
(void)fprintf(fp, "calibration interval: %d s\n",
1 << ntohs(ik->shift));
(void)fprintf(fp, "calibration cycles: %ld\n",