]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2592] Account for PPS sources which can provide an accurate absolute time stamp...
authorMartin Burnicki <burnicki@ntp.org>
Wed, 25 Mar 2015 16:32:25 +0000 (17:32 +0100)
committerMartin Burnicki <burnicki@ntp.org>
Wed, 25 Mar 2015 16:32:25 +0000 (17:32 +0100)
bk: 5512e319F4iR9HuSJk_19lXpCkTxZw

ChangeLog
include/ntp.h
ntpd/ntp_proto.c
ntpd/refclock_parse.c

index 4b62087820dcda9d550c5b11a7ca53869809eb70..c8b116987df3abff305fc6328cf40f7e098d58d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 ---
 
+* [Bug 2592] Account for PPS sources which can provide an accurate
+  absolute time stamp, and status information.
   Fixed indention and removed trailing whitespace.
 * [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003.
 * [Bug 2728] See if C99-style structure initialization works.
index 4281947470c8efa71d5860ee53c81279467f86ce..4ffc35f6febce274061aff17ed9b62fc1f400acc 100644 (file)
@@ -435,7 +435,7 @@ struct peer {
 #define        STRATUM_UNSPEC  ((u_char)16) /* unspecified */
 
 /*
- * Values for peer.flags
+ * Values for peer.flags (u_int)
  */
 #define        FLAG_CONFIG     0x0001  /* association was configured */
 #define        FLAG_PREEMPT    0x0002  /* preemptable association */
@@ -455,6 +455,7 @@ struct peer {
 #ifdef OPENSSL
 # define FLAG_ASSOC    0x8000  /* autokey request */
 #endif /* OPENSSL */
+#define FLAG_TSTAMP_PPS        0x10000 /* PPS source provides absolute timestamp */
 
 /*
  * Definitions for the clear() routine.  We use memset() to clear
index e8b1415f47baf1562414e66ee24ad2bcec0d1554..a1733944a725236dfd5ae294828e76cc7e19a7af 100644 (file)
@@ -2661,7 +2661,8 @@ clock_select(void)
                if (peer->flags & FLAG_PPS) {
                        if (typepps == NULL)
                                typepps = peer;
-                       continue;
+                       if (!(peer->flags & FLAG_TSTAMP_PPS))
+                               continue;
                }
 #endif /* REFCLOCK */
 
index 8db7677c9d5552f960ed3ecdcdacfa14ad86dad5..195ec39cb4f052b375432c2e10d10a2b8b952f19 100644 (file)
@@ -4192,13 +4192,13 @@ parse_process(
                 */
                if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
                        {
-                               parse->peer->flags |= FLAG_PPS;
+                               parse->peer->flags |= (FLAG_PPS | FLAG_TSTAMP_PPS);
                                parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
                        }
 #endif
        } else {
                parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
-               parse->peer->flags &= ~FLAG_PPS;
+               parse->peer->flags &= ~(FLAG_PPS | FLAG_TSTAMP_PPS);
        }
 
        /*