Signed-off-by: Richard Cochran <[email protected]>
---
msg.c | 2 +-
msg.h | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/msg.c b/msg.c
index 7edbdd2..06a3812 100644
--- a/msg.c
+++ b/msg.c
@@ -468,5 +468,5 @@ int msg_sots_missing(struct ptp_message *m)
default:
return 0;
}
- return (!m->hwts.ts.tv_sec && !m->hwts.ts.tv_nsec) ? 1 : 0;
+ return msg_sots_valid(m) ? 0 : 1;
}
diff --git a/msg.h b/msg.h
index 3fa5833..12e6ce8 100644
--- a/msg.h
+++ b/msg.h
@@ -339,6 +339,16 @@ void msg_put(struct ptp_message *m);
int msg_sots_missing(struct ptp_message *m);
/**
+ * Test whether a message has a valid SO_TIMESTAMPING time stamp.
+ * @param m Message to test.
+ * @return One if the message has a valid time stamp, zero otherwise.
+ */
+static inline int msg_sots_valid(struct ptp_message *m)
+{
+ return (m->hwts.ts.tv_sec || m->hwts.ts.tv_nsec) ? 1 : 0;
+}
+
+/**
* Work around buggy 802.1AS switches.
*/
extern int assume_two_step;
--
1.7.10.4
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel