]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
refclock_palisade.h, ChangeLog, refclock_palisade.c:
authorHal Murray <murray@ntp.org>
Sun, 1 Mar 2015 07:50:18 +0000 (02:50 -0500)
committerHal Murray <murray@ntp.org>
Sun, 1 Mar 2015 07:50:18 +0000 (02:50 -0500)
  Fix bug 2773 - early leap from Palisade/Thunderbolt

bk: 54f2c4ba2MMK1W4sNVVOgFk-rZL23g

ChangeLog
ntpd/refclock_palisade.c
ntpd/refclock_palisade.h

index 17017961366f73c7b2a94586c1b7c641c322d545..8911cc14567917c9af9f9ec32a47f6cfd5298c48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+
+* [Bug 2773] Early leap announcement from Palisade/Thunderbolt
 ---
 
 * [Bug 2728] See if C99-style structure initialization works.
index 2b396d8a51a19c3ebca54ab23c036133eb15edbc..0520311d1bc7ac88292b299d0c1db9513c3e1297 100644 (file)
@@ -584,7 +584,10 @@ TSIP_decode (
                                break;
                        }
 
-                       if (up->leap_status & PALISADE_LEAP_PENDING) {
+                       up->month = mb(15);
+                       if ( (up->leap_status & PALISADE_LEAP_PENDING) &&
+                       /* Avoid early announce: https://bugs.ntp.org/2773 */
+                               (6 == up->month || 12 == up->month) ) {
                                if (up->leap_status & PALISADE_UTC_TIME)  
                                        pp->leap = LEAP_ADDSECOND;
                                else
@@ -615,6 +618,7 @@ TSIP_decode (
                        pp->hour = mb(11);
                        pp->minute = mb(12);
                        pp->second = mb(13);
+                       up->month = mb(14);  /* Save for LEAP check */
 
 #ifdef DEBUG
                        if (debug > 1)
@@ -645,7 +649,9 @@ TSIP_decode (
                                printf("TSIP_decode: unit %d\n", up->unit);
                        }
 #endif
-                       if (getint((u_char *) &mb(10)) & 0x80) 
+                       if ( (getint((u_char *) &mb(10)) & 0x80) &&
+                       /* Avoid early announce: https://bugs.ntp.org/2773 */
+                           (6 == up->month || 12 == up->month) )
                                pp->leap = LEAP_ADDSECOND;  /* we ASSUME addsecond */
                        else 
                                pp->leap = LEAP_NOWARNING;
index 4f1ab266eef34f6728d9b9e626e92e8219db0f0e..3782a5eb92c773f9b61d74efcb25a4fefa99dcd9 100644 (file)
@@ -169,6 +169,7 @@ struct palisade_unit {
        short           rpt_cnt;        /* TSIP packet length so far */
        char            rpt_buf[BMAX];  /* packet assembly buffer */
        int             type;           /* Clock mode type */
+       int             month;          /* for LEAP filter */
 };
 
 /*