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
parent
ccfeb3b092
commit
dc0f6427bd
8
port.c
8
port.c
|
@ -2484,6 +2484,10 @@ static enum fsm_event bc_event(struct port *p, int fd_index)
|
||||||
msg_put(msg);
|
msg_put(msg);
|
||||||
return EV_NONE;
|
return EV_NONE;
|
||||||
}
|
}
|
||||||
|
if (port_ignore(p, msg)) {
|
||||||
|
msg_put(msg);
|
||||||
|
return EV_NONE;
|
||||||
|
}
|
||||||
if (msg_sots_missing(msg) &&
|
if (msg_sots_missing(msg) &&
|
||||||
!(p->timestamping == TS_P2P1STEP && msg_type(msg) == PDELAY_REQ)) {
|
!(p->timestamping == TS_P2P1STEP && msg_type(msg) == PDELAY_REQ)) {
|
||||||
pr_err("port %hu: received %s without timestamp",
|
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);
|
ts_add(&msg->hwts.ts, -p->rx_timestamp_offset);
|
||||||
clock_check_ts(p->clock, tmv_to_nanoseconds(msg->hwts.ts));
|
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)) {
|
switch (msg_type(msg)) {
|
||||||
case SYNC:
|
case SYNC:
|
||||||
|
|
Loading…
Reference in New Issue