From: Harlan Stenn Date: Sat, 23 May 2009 01:16:18 +0000 (-0400) Subject: xmt/aorg and leap_expire fixes from Dave Mills X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaef9c280d5511b30a64deaf58bc673e47ec4466;p=thirdparty%2Fntp.git xmt/aorg and leap_expire fixes from Dave Mills bk: 4a174e62l1SZuKr3dXHDcrJ2UnpZ4w --- diff --git a/ChangeLog b/ChangeLog index be25624a41..b4f8b95598 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* xmt -> aorg timestamp cleanup from Dave Mills, reported by Dave Hart. +* Leap/expire cleanup from Dave Mills. (4.2.5p178) 2009/05/21 Released by Harlan Stenn * Provide erealloc() and estrdup(), a la emalloc(). * Improve ntp.conf's parser error messages. diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 3d47ec5ed2..819eca85ea 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -967,6 +967,7 @@ crypto_recv( leap_expire = ntohl(ep->pkt[2]); crypto_update(); strcpy(str1, fstostr(leap_sec)); + strcpy(str2, fstostr(leap_expire)); snprintf(tbuf, sizeof(tbuf), "%d leap %s expire %s", leap_tai, str1, str2); diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index b3132f3b29..039bf4dbf4 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -995,7 +995,7 @@ findmanycastpeer( peer->next) { if (peer->cast_flags & MDF_ACAST) { NTOHL_FP(&pkt->org, &p_org); - if (L_ISEQU(&peer->xmt, &p_org)) + if (L_ISEQU(&p_org, &peer->aorg)) return (peer); } } diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 5a1a6e6fcd..9930d2b316 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -797,11 +797,10 @@ receive( sys_restricted++; return; /* not enabled */ } - if ((peer = newpeer(&rbufp->recv_srcadr, - rbufp->dstadr, MODE_CLIENT, - hisversion, NTP_MINDPOLL, NTP_MAXDPOLL, - FLAG_IBURST | FLAG_PREEMPT, MDF_UCAST | MDF_ACLNT, - 0, skeyid)) == NULL) { + if ((peer = newpeer(&rbufp->recv_srcadr, rbufp->dstadr, + MODE_CLIENT, hisversion, NTP_MINDPOLL, + NTP_MAXDPOLL, FLAG_IBURST | FLAG_PREEMPT, + MDF_UCAST | MDF_ACLNT, 0, skeyid)) == NULL) { sys_declined++; return; /* ignore duplicate */ } @@ -1062,6 +1061,8 @@ receive( peer->flip = 1; report_event(PEVNT_XLEAVE, peer, NULL); } + } else { + L_CLR(&peer->aorg); } /* @@ -1091,7 +1092,7 @@ receive( peer->rec = p_xmt; peer->dst = rbufp->recv_time; } - L_CLR(&peer->xmt); + peer->xmt = p_xmt; /* * If this is a crypto_NAK, the server cannot authenticate a