]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3461] refclock_shm.c: clear error status on clock recovery
authorJuergen Perlinger <perlinger@ntp.org>
Sun, 8 Apr 2018 10:17:35 +0000 (12:17 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Sun, 8 Apr 2018 10:17:35 +0000 (12:17 +0200)
bk: 5ac9ec3fo4sihX5QbDzqx44ut_I35w

ChangeLog
ntpd/ntp_io.c
ntpd/ntp_refclock.c
ntpd/refclock_shm.c

index 08b43a19a436d0329d9d8632c3303313d3b636a1..046c9342be2e9c1aef57fd81c4dbc9fb5ab4d0ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
 * [Bug 3467] Potential memory fault in ntpq [...] <perlinger@ntp.org>
   - fixed IO redirection and CTRL-C handling in ntq and ntpdc
 * [Bug 3465] Default TTL values cannot be used <perlinger@ntp.org>
+* [Bug 3461] refclock_shm.c: clear error status on clock recovery <perlinger@ntp.org>
+  - 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 <perlinger@ntp.org>
 * [Bug 2821] minor build issues <perlinger@ntp.org>
index af19931e49437ddbe35694213048a4e0a03dbc36..b89b996e9310c56d2f8a66ab9ced05a9a4160ea1 100644 (file)
@@ -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)
index a0dbd4ca83b6ce59ab39c184ee495b9405a66327..d109b7115793b6992c7c8a7be4080c5b2f7a8b6a 100644 (file)
@@ -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;
index f031a395cb993aec45c41f2fb2b3005e145cf556..da38355b4c21daf7465dab089aa674f46896f8eb 100644 (file)
@@ -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 */