From: Harlan Stenn Date: Fri, 28 Apr 2023 08:00:57 +0000 (-0500) Subject: syslog valid incoming KoDs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54aeaff5fc2987f26f76aacb84e9a182aae2c867;p=thirdparty%2Fntp.git syslog valid incoming KoDs bk: 644b7d39LR8CzJ7cSdNrTxQxPYxFgw --- diff --git a/ChangeLog b/ChangeLog index 6a333b89b..23c6a6c95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -75,6 +75,7 @@ Integrated patch from Brian Utterback. * [Bug 2525] Turn on automake subdir-objects across the project. * [Bug 2410] syslog an error message on panic exceeded. +* syslog valid incoming KoDs. * Rename a poorly-named variable. * Disable "embedded NUL in string" messages in libopts, when we can. * Use https in the AC_INIT URLs in configure.ac. diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index d7a8f5270..7de94c421 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -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)) {