Commit a65e4f02 authored by Alessandro Rubini's avatar Alessandro Rubini

bugfix: correctionField use

For two-step masters, the code was adding the correction fields of
sync and follow-up.  This is wrong, since the follow-up message only
carries the sender's timestamp for sync.  So, the only correction to
consider is the one in sync (which accounts for transparent clocks
the frames passed through).

The approach taken is promoting the current correction to be a ppi
field (like t1..t4), while killing the other "temporary" field that
was used before this commit to keep the value that was going to be added.

Note, however, that how cField is used in the back path (t3,t4) is not
clear to me, and the specification is not helping: if the correction
is automatically updated by transparent clocks in my path, the master
should send back to me the value it received for my delay request.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent a1b8d474
......@@ -155,7 +155,6 @@ struct pp_instance {
/* Times, for the various offset computations */
TimeInternal t1, t2, t3, t4; /* *the* stamps */
TimeInternal last_rcv_time, last_snt_time; /* two temporaries */
TimeInternal last_sync_corr_field;
/* Data sets */
DSDefault *defaultDS; /* page 65 */
......
......@@ -150,9 +150,6 @@ int st_com_slave_handle_sync(struct pp_instance *ppi, unsigned char *buf,
if ((hdr->flagField[0] & PP_TWO_STEP_FLAG) != 0) {
ppi->waiting_for_follow = TRUE;
ppi->recv_sync_sequence_id = hdr->sequenceId;
/* Save correctionField of Sync message */
cField_to_TimeInternal(&ppi->last_sync_corr_field,
hdr->correctionfield);
return 0;
}
msg_unpack_sync(buf, &sync);
......@@ -207,8 +204,6 @@ int st_com_slave_handle_followup(struct pp_instance *ppi, unsigned char *buf,
cField_to_TimeInternal(&correction_field,
ppi->received_ptp_header.correctionfield);
add_TimeInternal(&correction_field, &correction_field,
&ppi->last_sync_corr_field);
/* Call the extension; it may do it all and ask to return */
if (pp_hooks.handle_followup)
......
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