]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2836] DFC77 patches from Frank Kardel to make decoding more robust, and require...
authorHarlan Stenn <stenn@ntp.org>
Sun, 7 Jun 2015 03:16:04 +0000 (03:16 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sun, 7 Jun 2015 03:16:04 +0000 (03:16 +0000)
bk: 5573b774ggbLbu4ogRzKwzWcdirYdQ

ChangeLog
libparse/clk_rawdcf.c
libparse/parse.c
ntpd/refclock_parse.c

index c4689a73f83939ac0613f70a085538666ed3098e..032fb2da6ec85bf6e4ebfb8081cdde08000274cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
    This might still needed improvement.
 * [Bug 2832] refclock_jjy.c supports the TDC-300.
 * [Bug 2834] Correct a broken html tag in html/refclock.html
+* [Bug 2836] DFC77 patches from Frank Kardel to make decoding more
+  robust, and require 2 consecutive timestamps to be consistent.
 * [Bug 2837] Allow a configurable DSCP value.
 * [Bug 2837] add test for DSCP to ntpd/complete.conf.in
 * [Bug 2842] Glitch in ntp.conf.def documentation stanza.
index 132fbc33146e203b363786c6cbdddd47546056dc..2f2afdf941a2093d07c706039d9fbd5f4ccac142 100644 (file)
@@ -237,7 +237,7 @@ convert_rawdcf(
 #ifndef PARSEKERNEL
                msyslog(LOG_ERR, "parse: convert_rawdcf: INCOMPLETE DATA - time code only has %d bits", size);
 #endif
-               return CVT_NONE;
+               return CVT_FAIL|CVT_BADFMT;
        }
 
        for (i = 0; i < size; i++)
@@ -250,7 +250,7 @@ convert_rawdcf(
 #ifndef PARSEKERNEL
                        msyslog(LOG_ERR, "parse: convert_rawdcf: BAD DATA - no conversion");
 #endif
-                       return CVT_NONE;
+                       return CVT_FAIL|CVT_BADFMT;
                }
                if (*b) b++;
                if (*c) c++;
@@ -321,7 +321,7 @@ convert_rawdcf(
                 * bad format - not for us
                 */
 #ifndef PARSEKERNEL
-               msyslog(LOG_ERR, "parse: convert_rawdcf: parity check FAILED for \"%s\"", buffer);
+               msyslog(LOG_ERR, "parse: convert_rawdcf: start bit / parity check FAILED for \"%s\"", buffer);
 #endif
                return CVT_FAIL|CVT_BADFMT;
        }
@@ -496,11 +496,13 @@ cvt_rawdcf(
                        {
                                if ((newtime - t->tcode) == 60) /* guard against multi bit errors */
                                {
+                                       parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: minute delta check OK\n"));
                                        clock_time->utctime = newtime;
                                }
                                else
                                {
-                                       rtc = CVT_FAIL|CVT_BADTIME;
+                                       parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: minute delta check FAIL - ignore timestamp\n"));
+                                       rtc = CVT_SKIP;
                                }
                                t->tcode            = newtime;
                        }
index 9e663f911f74d12f6bb6722e31218f48d45a5086..64167f1520293488cad5e52c7e71987a45c1898a 100644 (file)
@@ -697,14 +697,14 @@ timepacket(
        {
        case CVT_FAIL:
                parseio->parse_badformat++;
-               break;
+               return cvtrtc;
 
        case CVT_NONE:
                /*
                 * too bad - pretend bad format
                 */
                parseio->parse_badformat++;
-               break;
+               return CVT_NONE;
 
        case CVT_OK:
                break;
index 195ec39cb4f052b375432c2e10d10a2b8b952f19..6801f6209b48d14e46917507436a65a3213a861a 100644 (file)
@@ -3782,6 +3782,8 @@ parse_process(
                                        msyslog(LOG_WARNING, "PARSE receiver #%d: FAILED TIMECODE: \"%s\" (check receiver configuration / wiring)",
                                                CLK_UNIT(parse->peer), mkascii(buffer, sizeof buffer, tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count - 1)));
                        }
+                       /* copy status to show only changes in case of failures */
+                       parse->timedata.parse_status = parsetime->parse_status;
                }
        }