]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
xmt/aorg and leap_expire fixes from Dave Mills
authorHarlan Stenn <stenn@ntp.org>
Sat, 23 May 2009 01:16:18 +0000 (21:16 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 23 May 2009 01:16:18 +0000 (21:16 -0400)
bk: 4a174e62l1SZuKr3dXHDcrJ2UnpZ4w

ChangeLog
ntpd/ntp_crypto.c
ntpd/ntp_peer.c
ntpd/ntp_proto.c

index be25624a418edc0d0c466e8ebdb2028acdba8be6..b4f8b9559801dce04d86180270ebe3976ff6fdec 100644 (file)
--- 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 <stenn@ntp.org>
 * Provide erealloc() and estrdup(), a la emalloc().
 * Improve ntp.conf's parser error messages.
index 3d47ec5ed2a5753662db9977416237eb39ca7864..819eca85ea70e432d68ccbba845d48d91f2cf2d6 100644 (file)
@@ -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);
index b3132f3b290cd0cc344bb406570fe3afcc855238..039bf4dbf4d1f9ea73a92264eca6756bda149510 100644 (file)
@@ -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);
                        }
                }
index 5a1a6e6fcd43eec4d6654993be4fcb52db6917f1..9930d2b3166c6d3dd665a5bd733c1b296f8ce2ca 100644 (file)
@@ -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