msg: Detect missing HW time stamps on duplicated messages.
As ofmaster510777deca
message layer no longer returns -ETIME. Callers of msg_post_recv() are expected to check for missing time stamps themselves, but the message duplication function followed the obsolete code pattern of expecting that msg_post_recv() performs the check. This patch fixes the method to check properly for this error condition. Fixes:51b540875f
("msg: Introduce a method to copy a message.") Signed-off-by: Richard Cochran <richardcochran@gmail.com>
parent
7a76c36b34
commit
29cd088347
11
msg.c
11
msg.c
|
@ -315,10 +315,6 @@ struct ptp_message *msg_duplicate(struct ptp_message *msg, int cnt)
|
|||
case -EBADMSG:
|
||||
pr_err("msg_duplicate: bad message");
|
||||
break;
|
||||
case -ETIME:
|
||||
pr_err("msg_duplicate: received %s without timestamp",
|
||||
msg_type_string(msg_type(msg)));
|
||||
break;
|
||||
case -EPROTO:
|
||||
pr_debug("msg_duplicate: ignoring message");
|
||||
break;
|
||||
|
@ -326,6 +322,13 @@ struct ptp_message *msg_duplicate(struct ptp_message *msg, int cnt)
|
|||
msg_put(dup);
|
||||
return NULL;
|
||||
}
|
||||
if (msg_sots_missing(msg)) {
|
||||
pr_err("msg_duplicate: received %s without timestamp",
|
||||
msg_type_string(msg_type(msg)));
|
||||
msg_put(dup);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dup;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue