From: Harlan Stenn Date: Fri, 13 Apr 2007 07:57:20 +0000 (-0400) Subject: refclock_wwv.c fixes from Dave Mills X-Git-Tag: NTP_4_2_5P22~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=010242ad3ab80376e3e40765b3473db2472864bc;p=thirdparty%2Fntp.git refclock_wwv.c fixes from Dave Mills bk: 461f37e0iBiWlZFerGYCE990U-TsQQ --- diff --git a/ChangeLog b/ChangeLog index 890df9419..b8fbc4299 100644 --- 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. diff --git a/ntpd/refclock_wwv.c b/ntpd/refclock_wwv.c index 430f09fb5..e126056cb 100644 --- a/ntpd/refclock_wwv.c +++ b/ntpd/refclock_wwv.c @@ -137,7 +137,7 @@ #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)