]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
WWV refclock fixes from Dave Mills
authorHarlan Stenn <stenn@ntp.org>
Tue, 12 Sep 2006 08:03:30 +0000 (04:03 -0400)
committerHarlan Stenn <stenn@ntp.org>
Tue, 12 Sep 2006 08:03:30 +0000 (04:03 -0400)
bk: 450669d2bb3hozLsv5al9bab0kDYPA

ntpd/refclock_wwv.c

index 3477ed57bc6d2dd2d6a8c6b6c38943ca1c1c30d3..cfc94b1b47d9dd9ca577ecc45ed4d94749cb647c 100644 (file)
@@ -1459,14 +1459,17 @@ wwv_endpoc(
         * If the epoch candidate is the same as the last one, increment
         * the run counter. If not, save the length, epoch and end
         * time of the current run for use later and reset the counter.
-        * If the run is at least SCMP (10) s, the SSYNC bit is lit and
-        * the epoch considered valid for synchronization.
+        * The epoch is considered valid if the run is at least SCMP
+        * (10) s, the minute is synchronized and the interval since the
+        * last epoch  is not greater than the averaging interval. Thus,
+        * after a long absence, the program will wait a full averaging
+        * interval while the integrator charges up.
         */
        tmp2 = (tepoch - xepoch) % SECOND;
        if (tmp2 == 0) {
                syncnt++;
-               if (syncnt > SCMP && up->status & MSYNC && up->status &
-                   FGATE) {
+               if (syncnt > SCMP && up->status & MSYNC && (up->status &
+                   FGATE || scount - zcount <= up->avgint)) {
                        up->status |= SSYNC;
                        up->yepoch = tepoch;
                }