From: Juergen Perlinger Date: Sun, 8 Apr 2018 10:17:35 +0000 (+0200) Subject: [Bug 3461] refclock_shm.c: clear error status on clock recovery X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36c74545347f75312734731a605ef1455b2e3ec5;p=thirdparty%2Fntp.git [Bug 3461] refclock_shm.c: clear error status on clock recovery bk: 5ac9ec3fo4sihX5QbDzqx44ut_I35w --- diff --git a/ChangeLog b/ChangeLog index 08b43a19a..046c9342b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ * [Bug 3467] Potential memory fault in ntpq [...] - fixed IO redirection and CTRL-C handling in ntq and ntpdc * [Bug 3465] Default TTL values cannot be used +* [Bug 3461] refclock_shm.c: clear error status on clock recovery + - initial patch by Hal Murray; also fixed refclock_report() trouble * [Bug 3456] Use uintptr_t rather than size_t to store an integer in a pointer - According to Brooks Davis, there was only one location * [Bug 2821] minor build issues diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index af19931e4..b89b996e9 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -3133,7 +3133,7 @@ sendpkt( int cc; int rc; u_char cttl; - l_fp fp_zero = { 0, 0 }; + l_fp fp_zero = { { 0 }, 0 }; ismcast = IS_MCAST(dest); if (!ismcast) diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c index a0dbd4ca8..d109b7115 100644 --- a/ntpd/ntp_refclock.c +++ b/ntpd/ntp_refclock.c @@ -112,7 +112,7 @@ refclock_report( /* ignore others */ break; } - if (pp->lastevent < 15) + if ((code != CEVNT_NOMINAL) && (pp->lastevent < 15)) pp->lastevent++; if (pp->currentstatus != code) { pp->currentstatus = (u_char)code; diff --git a/ntpd/refclock_shm.c b/ntpd/refclock_shm.c index f031a395c..da38355b4 100644 --- a/ntpd/refclock_shm.c +++ b/ntpd/refclock_shm.c @@ -340,6 +340,7 @@ shm_poll( if (pp->coderecv != pp->codeproc) { /* have some samples, everything OK */ pp->lastref = pp->lastrec; + refclock_report(peer, CEVNT_NOMINAL); refclock_receive(peer); } else if (NULL == up->shm) { /* is this possible at all? */ /* we're out of business without SHM access */