From: Harlan Stenn Date: Wed, 8 Mar 2017 11:11:49 +0000 (-0500) Subject: [Bug 3358] Spurious KoD log messages in .INIT. phase X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe8389bceb5dc78c1ae79e16cdf7ff1fa13325e1;p=thirdparty%2Fntp.git [Bug 3358] Spurious KoD log messages in .INIT. phase bk: 58bfe6f5saCUSRPeCg_h8_hrPkWp6Q --- diff --git a/ChangeLog b/ChangeLog index 6e715c6f6..ef4eac98f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +--- + +* [Bug 3358] Spurious KoD log messages in .INIT. phase. HStenn. + --- (4.2.8p10) diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index c5d7cc6db..b1340c569 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -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