]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
syslog valid incoming KoDs
authorHarlan Stenn <stenn@ntp.org>
Fri, 28 Apr 2023 08:00:57 +0000 (03:00 -0500)
committerHarlan Stenn <stenn@ntp.org>
Fri, 28 Apr 2023 08:00:57 +0000 (03:00 -0500)
bk: 644b7d39LR8CzJ7cSdNrTxQxPYxFgw

ChangeLog
ntpd/ntp_proto.c

index 6a333b89beaba40fdc1a125157c52cc8f99ac65e..23c6a6c957a769b928645624beb5360f8dd22e70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,7 @@
              Integrated patch from Brian Utterback. <hart@ntp.org>
 * [Bug 2525] Turn on automake subdir-objects across the project. <hart@ntp.org>
 * [Bug 2410] syslog an error message on panic exceeded. <brian.utterback@oracle.com>
+* syslog valid incoming KoDs.  <stenn@ntp.org>
 * Rename a poorly-named variable.  <stenn@ntp.org>
 * Disable "embedded NUL in string" messages in libopts, when we can. <stenn@>
 * Use https in the AC_INIT URLs in configure.ac.  <stenn@ntp.org>
index d7a8f5270eaaee398c1021db46da3886408ee296..7de94c421cf833a4adb446a44d9f83d7a0fbe6de 100644 (file)
@@ -1984,32 +1984,36 @@ receive(
                        return;
                }
 
-       /*
-        * Basic mode checks:
-        *
-        * If there is no origin timestamp, it's either an initial packet
-        * or we've already received a response to our query.  Of course,
-        * should 'aorg' be all-zero because this really was the original
-        * transmit timestamp, we'll ignore this reply.  There is a window
-        * of one nanosecond once every 136 years' time where this is
-        * possible.  We currently ignore this situation, as a completely
-        * zero timestamp is (quietly?) disallowed.
-        *
-        * Otherwise, check for bogus packet in basic mode.
-        * If it is bogus, switch to interleaved mode and resynchronize,
-        * but only after confirming the packet is not bogus in
-        * symmetric interleaved mode.
-        *
-        * This could also mean somebody is forging packets claiming to
-        * be from us, attempting to cause our server to KoD us.
-        *
-        * We have earlier asserted that hisstratum cannot be 0.
-        * If hisstratum is STRATUM_UNSPEC, it means he's not sync'd.
-        */
+               /*
+                * Basic mode checks:
+                *
+                * If there is no origin timestamp, it's either an initial
+                * packet or we've already received a response to our query.
+                * Of course, should 'aorg' be all-zero because this really
+                * was the original transmit timestamp, we'll ignore this
+                * reply.  There is a window of one nanosecond once every
+                * 136 years' time where this is possible.  We currently
+                * ignore this situation, as a completely zero timestamp
+                * is (quietly?) disallowed.
+                *
+                * Otherwise, check for bogus packet in basic mode.
+                * If it is bogus, switch to interleaved mode and
+                * resynchronize, but only after confirming the packet is
+                * not bogus in symmetric interleaved mode.
+                *
+                * This could also mean somebody is forging packets claiming
+                * to be from us, attempting to cause our server to KoD us.
+                *
+                * We have earlier asserted that hisstratum cannot be 0.
+                * If hisstratum is STRATUM_UNSPEC, it means he's not sync'd.
+                */
 
-       /* XXX: FLAG_LOOPNONCE */
-       DEBUG_INSIST(0 == (FLAG_LOOPNONCE & peer->flags));
+               /* XXX: FLAG_LOOPNONCE */
+               DEBUG_INSIST(0 == (FLAG_LOOPNONCE & peer->flags));
 
+               msyslog(LOG_INFO,
+                       "receive: Got KoD %s from %s",
+                       pkt->refid, ntoa(&peer->srcadr));
        } else if (peer->flip == 0) {
                if (0) {
                } else if (L_ISZERO(&p_org)) {