]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3358] Spurious KoD log messages in .INIT. phase
authorHarlan Stenn <stenn@ntp.org>
Wed, 8 Mar 2017 11:11:49 +0000 (06:11 -0500)
committerHarlan Stenn <stenn@ntp.org>
Wed, 8 Mar 2017 11:11:49 +0000 (06:11 -0500)
bk: 58bfe6f5saCUSRPeCg_h8_hrPkWp6Q

ChangeLog
ntpd/ntp_proto.c

index 6e715c6f6d49beed2dace7907ae660bb583fb03e..ef4eac98f9b4db8c1a2367aaa19e95ed8f8f5716 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+---
+
+* [Bug 3358] Spurious KoD log messages in .INIT. phase.  HStenn.
+
 ---
 (4.2.8p10)
 
index c5d7cc6db4a865764aab004c43126c373a97d071..b1340c569e56605897ea246df08cb0195de6a0bd 100644 (file)
@@ -51,8 +51,7 @@ enum kiss_codes {
        RATEKISS,                       /* Rate limit Kiss Code */
        DENYKISS,                       /* Deny Kiss */
        RSTRKISS,                       /* Restricted Kiss */
-       XKISS,                          /* Experimental Kiss */
-       UNKNOWNKISS                     /* Unknown Kiss Code */
+       XKISS                           /* Experimental Kiss */
 };
 
 enum nak_error_codes {
@@ -260,12 +259,9 @@ kiss_code_check(
                        return (RSTRKISS);
                } else if(memcmp(&refid,"X", 1) == 0) {
                        return (XKISS);
-               } else {
-                       return (UNKNOWNKISS);
                }
-       } else {
-               return (NOKISS);
        }
+       return (NOKISS);
 }
 
 
@@ -1575,9 +1571,12 @@ receive(
         * A KoD packet we pay attention to cannot have a 0 transmit
         * timestamp.
         */
+
+       kissCode = kiss_code_check(hisleap, hisstratum, hismode, pkt->refid);
+
        if (L_ISZERO(&p_xmt)) {
                peer->flash |= TEST3;                   /* unsynch */
-               if (STRATUM_UNSPEC == hisstratum) {     /* KoD packet */
+               if (kissCode != NOKISS) {               /* KoD packet */
                        peer->bogusorg++;               /* for TEST2 or TEST3 */
                        msyslog(LOG_INFO,
                                "receive: Unexpected zero transmit timestamp in KoD from %s",
@@ -1628,7 +1627,7 @@ receive(
         * (nonzero) org, rec, and xmt timestamps set to the xmt timestamp
         * that we have previously sent out.  Watch interleave mode.
         */
-       } else if (STRATUM_UNSPEC == hisstratum) {
+       } else if (kissCode != NOKISS) {
                DEBUG_INSIST(!L_ISZERO(&p_xmt));
                if (   L_ISZERO(&p_org)         /* We checked p_xmt above */
                    || L_ISZERO(&p_rec)) {
@@ -1901,11 +1900,9 @@ receive(
 
        /*
         * Check for any kiss codes. Note this is only used when a server
-        * responds to a packet request
+        * responds to a packet request.
         */
 
-       kissCode = kiss_code_check(hisleap, hisstratum, hismode, pkt->refid);
-
        /*
         * Check to see if this is a RATE Kiss Code
         * Currently this kiss code will accept whatever poll