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 <perich@google.com>
Signed-off-by: Cliff Spradlin <cspradlin@google.com>
master
Cliff Spradlin via Linuxptp-devel 2018-06-08 11:01:37 -07:00 committed by Richard Cochran
parent ccfeb3b092
commit dc0f6427bd
1 changed files with 4 additions and 4 deletions

8
port.c
View File

@ -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: