From dc0f6427bd1d0b58e245c7d8f59c51aa23ae657a Mon Sep 17 00:00:00 2001 From: Cliff Spradlin via Linuxptp-devel Date: Fri, 8 Jun 2018 11:01:37 -0700 Subject: [PATCH] port: don't clockcheck timestamps from other domains ptp4l runs clockcheck on an incoming PTP message before checking its domain number. If the time on another domain is different, then clockcheck will trigger spurious synchronization faults. This patch reorders the logic so that clockcheck only runs on messages in the same time domain. Reported-By: Filip Perich Signed-off-by: Cliff Spradlin --- port.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/port.c b/port.c index a777701..ddb064a 100644 --- a/port.c +++ b/port.c @@ -2484,6 +2484,10 @@ static enum fsm_event bc_event(struct port *p, int fd_index) msg_put(msg); return EV_NONE; } + if (port_ignore(p, msg)) { + msg_put(msg); + return EV_NONE; + } if (msg_sots_missing(msg) && !(p->timestamping == TS_P2P1STEP && msg_type(msg) == PDELAY_REQ)) { pr_err("port %hu: received %s without timestamp", @@ -2495,10 +2499,6 @@ static enum fsm_event bc_event(struct port *p, int fd_index) ts_add(&msg->hwts.ts, -p->rx_timestamp_offset); clock_check_ts(p->clock, tmv_to_nanoseconds(msg->hwts.ts)); } - if (port_ignore(p, msg)) { - msg_put(msg); - return EV_NONE; - } switch (msg_type(msg)) { case SYNC: