On the transmit path, the port-level code calls msg_sots_missing() directly, but on receive this check is buried in the message layer. With the coming addition of peer to peer one step, the ingress check will need knowledge of the configured time stamping option. This patch moves the check in order to accommodate the exceptional case.
Signed-off-by: Richard Cochran <richardcoch...@gmail.com> --- msg.c | 3 --- port.c | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/msg.c b/msg.c index a36d4d0..616d937 100644 --- a/msg.c +++ b/msg.c @@ -390,9 +390,6 @@ int msg_post_recv(struct ptp_message *m, int cnt) break; } - if (msg_sots_missing(m)) - return -ETIME; - err = suffix_post_recv(m, suffix, cnt - pdulen); if (err) return err; diff --git a/port.c b/port.c index 8191e77..561b832 100644 --- a/port.c +++ b/port.c @@ -2488,10 +2488,6 @@ enum fsm_event port_event(struct port *p, int fd_index) case -EBADMSG: pr_err("port %hu: bad message", portnum(p)); break; - case -ETIME: - pr_err("port %hu: received %s without timestamp", - portnum(p), msg_type_string(msg_type(msg))); - break; case -EPROTO: pr_debug("port %hu: ignoring message", portnum(p)); break; @@ -2499,6 +2495,12 @@ enum fsm_event port_event(struct port *p, int fd_index) msg_put(msg); return EV_NONE; } + if (msg_sots_missing(msg)) { + pr_err("port %hu: received %s without timestamp", + portnum(p), msg_type_string(msg_type(msg))); + msg_put(msg); + return EV_NONE; + } 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)); -- 2.11.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel