From: Harlan Stenn Date: Thu, 8 Oct 2009 23:48:15 +0000 (-0400) Subject: Broadcast and transit phase cleanup from Dave Mills X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec18d08f9db5ec8a5701c9f272f515c6b358a454;p=thirdparty%2Fntp.git Broadcast and transit phase cleanup from Dave Mills bk: 4ace7a3fiffP7_5KZBotmQNrs6OsJQ --- diff --git a/ChangeLog b/ChangeLog index e8a978b3ed..cfba5184fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* Broadcast and transit phase cleanup from Dave Mills. (4.2.5p229) 2009/10/07 Released by Harlan Stenn * [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'. * Change ntpsnmpd/Makefile.am include file order to fix FreeBSD build. diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 90d2be0b93..89d01891c3 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -1437,8 +1437,8 @@ crypto_verify( if (len < VALUE_LEN) return (XEVNT_LEN); - if (opcode == (CRYPTO_AUTO | CRYPTO_RESP) && - peer->cast_flags & MDF_BCLNT) { + if (opcode == (CRYPTO_AUTO | CRYPTO_RESP) && (peer->pmode == + MODE_BROADCAST || (peer->cast_flags & MDF_BCLNT))) { if (ntohl(ep->associd) != peer->assoc) return (XEVNT_ERR); } else { diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 0e0b492567..1b9d4432e0 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -1287,11 +1287,17 @@ receive( process_packet(peer, pkt, rbufp->recv_length); /* - * In interleaved mode update the state variables. + * In interleaved mode update the state variables. Also adjust the + * transmit phase to avoid crossover. */ if (peer->flip != 0) { peer->rec = p_rec; peer->dst = rbufp->recv_time; + if (peer->nextdate - current_time < (1 << min(peer->ppoll, + peer->hpoll)) / 2) + peer->nextdate++; + else + peer->nextdate--; } }