]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
refclock_wwv.c fixes from Dave Mills
authorHarlan Stenn <stenn@ntp.org>
Fri, 13 Apr 2007 07:57:20 +0000 (03:57 -0400)
committerHarlan Stenn <stenn@ntp.org>
Fri, 13 Apr 2007 07:57:20 +0000 (03:57 -0400)
bk: 461f37e0iBiWlZFerGYCE990U-TsQQ

ChangeLog
ntpd/refclock_wwv.c

index 890df94196d6428d6ce4c3c0501014be985eb582..b8fbc42997dfb1aaaab1d5ab798c12e1e9278570 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* refclock_wwv.c fixes from Dave Mills.
 * [Bug 810] Fix ntp-keygen documentation.
 * [Bug 789] Fix multicast client crypto authentication and make sure arriving
            multicast packets do not disturb the autokey dance.
index 430f09fb5d653233e8ca44e778b9164e4b852699..e126056cbc6db6c7d614ca652c44f3631d7f3ce1 100644 (file)
 #define FGATE          0x0010  /* frequency gate */
 #define DGATE          0x0020  /* data pulse amplitude error */
 #define BGATE          0x0040  /* data pulse width error */
-#define        METRIC          0x0080  /*one or more stations heard */
+#define        METRIC          0x0080  /* one or more stations heard */
 #define LEPSEC         0x1000  /* leap minute */
 
 /*
@@ -2443,9 +2443,9 @@ wwv_newchan(
         * greater than the threshold, tune to that frequency and
         * transmitter QTH.
         */
+       up->status &= ~(SELV | SELH);
        if (rank < MTHR) {
                up->dchan = (up->dchan + 1) % NCHAN;
-               up->status &= ~(SELV | SELH);
                if (up->status & METRIC) {
                        up->status &= ~METRIC;
                        refclock_report(peer, CEVNT_PROP);
@@ -2453,18 +2453,20 @@ wwv_newchan(
                rval = FALSE;
        } else {
                up->dchan = j;
-               up->status |= SELV | SELH;
                up->sptr = sp;
                memcpy(&pp->refid, sp->refid, 4);
                peer->refid = pp->refid;
-               if (sp->select & SELV)
+               up->status |= METRIC;
+               if (sp->select & SELV) {
+                       up->status |= SELV;
                        up->pdelay = pp->fudgetime1;
-               else if (sp->select & SELH)
+               } else if (sp->select & SELH) {
+                       up->status |= SELH;
                        up->pdelay = pp->fudgetime2;
-               else
+               } else {
                        up->pdelay = 0;
+               }
                rval = TRUE;
-               up->status |= METRIC;
        }
 #ifdef ICOM
        if (up->fd_icom > 0)