[Linuxptp-devel] [PATCH v3 3/5] port: Don't check timestamps from non-slave ports.
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Miroslav L. <mli...@re...> - 2021-05-31 09:08:15
|
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. Reviewed-by: Jacob Keller <jac...@in...> Signed-off-by: Miroslav Lichvar <mli...@re...> --- 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 |