Don't perform the sanity check on receive timestamps from ports in
non-slave states to avoid false positives in the jbod mode, where
the timestamps can be generated by different clocks.

Reported-by: Amar Subramanyam <asubraman...@altiostar.com>
Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 port.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/port.c b/port.c
index 10bb9e1..fb420fb 100644
--- a/port.c
+++ b/port.c
@@ -2744,7 +2744,10 @@ static enum fsm_event bc_event(struct port *p, int 
fd_index)
        }
        if (msg_sots_valid(msg)) {
                ts_add(&msg->hwts.ts, -p->rx_timestamp_offset);
-               clock_check_ts(p->clock, tmv_to_nanoseconds(msg->hwts.ts));
+               if (p->state == PS_SLAVE) {
+                       clock_check_ts(p->clock,
+                                      tmv_to_nanoseconds(msg->hwts.ts));
+               }
        }
 
        switch (msg_type(msg)) {
-- 
2.26.3



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to