From: Harlan Stenn Date: Sun, 10 Aug 2008 07:11:51 +0000 (-0400) Subject: [Bug 861] leap info was not being transmitted X-Git-Tag: NTP_4_2_5P123~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8780bd6a1143d4a5750b5d131dccdea86968931f;p=thirdparty%2Fntp.git [Bug 861] leap info was not being transmitted bk: 489e94b7y9FDoTokpGCTAJN8mW9hpA --- diff --git a/ChangeLog b/ChangeLog index d024b2a95..23968058f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 861] leap info was not being transmitted. * [Bug 1046] refnumtoa.c is using the wrong header file. * [Bug 1047] enable/disable options processing fix. * header file cleanup. diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 9c0b251a4..8929fa80b 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -572,7 +572,7 @@ crypto_recv( fstamp |= CRYPTO_FLAG_COOK; else if (hismode == MODE_SERVER) fstamp |= CRYPTO_FLAG_AUTO; - if (!(fstamp & CRYPTO_FLAG_LEAP)) + if (!(fstamp & CRYPTO_FLAG_TAI)) fstamp |= CRYPTO_FLAG_LEAP; RAND_bytes((u_char *)&peer->hcookie, 4); peer->crypto = fstamp; @@ -1844,7 +1844,7 @@ crypto_update(void) if (EVP_SignFinal(&ctx, tai_leap.sig, &len, sign_pkey)) tai_leap.siglen = htonl(len); if (leap_sec > 0) - crypto_flags |= CRYPTO_FLAG_LEAP; + crypto_flags |= CRYPTO_FLAG_TAI; snprintf(statstr, NTP_MAXSTRLEN, "signature update ts %u", ntohl(hostval.tstamp)); record_crypto_stats(NULL, statstr); diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c index 40753a872..b28b9caf0 100644 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@ -349,7 +349,7 @@ timer(void) */ if (leapsec > 0) { leapsec--; - if (leap_sec == 0) { + if (leapsec == 0) { sys_leap = LEAP_NOWARNING; sys_tai = leap_tai; #ifdef KERNEL_PLL diff --git a/ntpd/refclock_local.c b/ntpd/refclock_local.c index 7538a780b..ffc052c0a 100644 --- a/ntpd/refclock_local.c +++ b/ntpd/refclock_local.c @@ -239,7 +239,10 @@ local_poll( pp->disp = 0; pp->jitter = 0; #else /* KERNEL_PLL LOCKCLOCK */ - pp->leap = LEAP_NOWARNING; + if (pp->sloppyclockflag & CLK_FLAG1) + pp->leap = LEAP_ADDSECOND; + else + pp->leap = LEAP_NOWARNING; pp->disp = DISPERSION; pp->jitter = 0; #endif /* KERNEL_PLL LOCKCLOCK */