From: Hal Murray Date: Sun, 1 Mar 2015 07:50:18 +0000 (-0500) Subject: refclock_palisade.h, ChangeLog, refclock_palisade.c: X-Git-Tag: NTP_4_3_4~2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d40d3461e642a5a9e7b34f602fbf33ee875fdf6e;p=thirdparty%2Fntp.git refclock_palisade.h, ChangeLog, refclock_palisade.c: Fix bug 2773 - early leap from Palisade/Thunderbolt bk: 54f2c4ba2MMK1W4sNVVOgFk-rZL23g --- diff --git a/ChangeLog b/ChangeLog index 170179613..8911cc145 100644 --- 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. diff --git a/ntpd/refclock_palisade.c b/ntpd/refclock_palisade.c index 2b396d8a5..0520311d1 100644 --- a/ntpd/refclock_palisade.c +++ b/ntpd/refclock_palisade.c @@ -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; diff --git a/ntpd/refclock_palisade.h b/ntpd/refclock_palisade.h index 4f1ab266e..3782a5eb9 100644 --- a/ntpd/refclock_palisade.h +++ b/ntpd/refclock_palisade.h @@ -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 */ }; /*