Commit e31d29b6 authored by Aurelio Colosimo's avatar Aurelio Colosimo Committed by Alessandro Rubini

proto-standard/common-func.c: fix st_com_slave_handle_announce function

Since we have a call to bmc inside this function, we do not need to
unpack Announce message locally.

This patch fixes a bug with white rabbit extension, since it did not
update the foreign master record with most recent wrFlags. As a result,
at the end of wr handshaking, the slave (very often) did not handle
correctly the parentWrModeOn flag.
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 147e3d69
...@@ -107,18 +107,12 @@ int st_com_slave_handle_announce(struct pp_instance *ppi, unsigned char *buf, ...@@ -107,18 +107,12 @@ int st_com_slave_handle_announce(struct pp_instance *ppi, unsigned char *buf,
int len) int len)
{ {
MsgHeader *hdr = &ppi->received_ptp_header; MsgHeader *hdr = &ppi->received_ptp_header;
MsgAnnounce ann;
if (len < PP_ANNOUNCE_LENGTH) if (len < PP_ANNOUNCE_LENGTH)
return -1; return -1;
if (ppi->is_from_cur_par) { /* st_com_add_foreign takes care of announce unpacking */
msg_unpack_announce(buf, &ann); st_com_add_foreign(ppi, buf);
s1(ppi, hdr, &ann);
} else {
/* st_com_add_foreign takes care of announce unpacking */
st_com_add_foreign(ppi, buf);
}
/*Reset Timer handling Announce receipt timeout*/ /*Reset Timer handling Announce receipt timeout*/
pp_timeout_restart_annrec(ppi); pp_timeout_restart_annrec(ppi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment