]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
systime.c:
authorHarlan Stenn <stenn@ntp.org>
Sat, 28 Jul 2007 03:47:45 +0000 (23:47 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 28 Jul 2007 03:47:45 +0000 (23:47 -0400)
  fuzz cleanup
ntp_loopfilter.c, ntp_proto.c:
  Show more digits during some debug printfs. Use the correct packet stratum in KISS codes.

bk: 46aabc61KrRdCKu-tMVQpDaX1tzlJg

libntp/systime.c
ntpd/ntp_loopfilter.c
ntpd/ntp_proto.c

index 45aaabacf57c2994023af4750ab37f0d70fc87ed..9391e5139509d2589be596cd2767fb32451ef540 100644 (file)
@@ -67,6 +67,7 @@ get_systime(
        getclock(TIMEOFDAY, &ts);
 # endif
        now->l_i = ts.tv_sec + JAN_1970;
+       now->l_uf |= ntp_random() & 0x3;
        dtemp = sys_residual + ts.tv_nsec / 1e9;
        if (dtemp >= 1.) {
                dtemp -= 1.;
@@ -76,7 +77,6 @@ get_systime(
                now->l_i--;
        }
        now->l_uf = (u_int32)(dtemp * FRAC);
-       now->l_uf |= ntp_random() & 0x3;
 
 #else /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */
        struct timeval tv;      /* seconds and microseconds */
@@ -87,6 +87,7 @@ get_systime(
         */
        GETTIMEOFDAY(&tv, NULL);
        now->l_i = tv.tv_sec + JAN_1970;
+       now->l_uf |= ntp_random() & 0xfff;
        dtemp = sys_residual + tv.tv_usec / 1e6;
        if (dtemp >= 1.) {
                dtemp -= 1.;
@@ -96,7 +97,6 @@ get_systime(
                now->l_i--;
        }
        now->l_uf = (u_int32)(dtemp * FRAC);
-       now->l_uf |= ntp_random() & 0xfff;
 
 #endif /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */
 }
index e19327c605fff93ae05224a38b277ad7954e853f..d04e5ba2524d622a1cfa8d7737130cbab9f17d8f 100644 (file)
@@ -780,7 +780,7 @@ rstclock(
 {
 #ifdef DEBUG
        if (debug)
-               printf("local_clock: at %lu offset %.6f freq %.3f state %d step %d\n",
+               printf("local_clock: at %lu offset %.9f freq %.6f state %d step %d\n",
                    update, offset, drift_comp * 1e6, trans,
                    clock_stepcnt);
 #endif
index 56254b287f4cb3bb87e291a77b6d0d1c1be8ebba..2431ba4270d0195370ab34aabc31c9b47635a43d 100644 (file)
@@ -1261,7 +1261,7 @@ process_packet(
        p_del = t21 - t34;
 #ifdef DEBUG
        if (debug > 1)
-               printf("proto: t21 %.6lf %d t34 %.6lf %d\n", peer->t21,
+               printf("proto: t21 %.9lf %d t34 %.9lf %d\n", peer->t21,
                    peer->t21_bytes, peer->t34, peer->t34_bytes);
 #endif
 
@@ -2981,7 +2981,7 @@ fast_xmit(
                sys_kod--;
                xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
                    PKT_VERSION(rpkt->li_vn_mode), xmode);
-               xpkt.stratum = STRATUM_UNSPEC;
+               xpkt.stratum = STRATUM_PKT_UNSPEC;
                memcpy(&xpkt.refid, "RATE", 4);
                xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay));
                xpkt.rootdispersion =