Commit 6e033a57 authored by Jean-Claude BAU's avatar Jean-Claude BAU Committed by Adam Wujek

Fix issue on Erbest computation (follow-up)

    According to the clause 9.3.2.3, the qualification is now not
evaluated for the ErBest foreign master.
    On ANN_RECEIPT timout, the ErBest is removed from the list of
foreign master to avoid to jump immediately to SLAVE state
parent 0141769d
......@@ -67,7 +67,7 @@ static int run_all_state_machines(struct pp_globals *ppg)
pp_leave_current_state(ppi);
ppi->n_ops->exit(ppi);
ppi->frgn_rec_num = 0;
ppi->frgn_rec_best = 0;
ppi->frgn_rec_best = -1;
if (ppg->ebest_idx == ppi->port_idx)
wr_servo_reset(ppi);
}
......
......@@ -29,13 +29,13 @@ static int passive_handle_announce(struct pp_instance *ppi, void *buf, int len)
{
int ret = 0;
MsgHeader *hdr = &ppi->received_ptp_header;
struct pp_frgn_master *erbest = &ppi->frgn_master[ppi->frgn_rec_best];
struct pp_frgn_master *erbest = ppi->frgn_rec_best!=-1 ? &ppi->frgn_master[ppi->frgn_rec_best] : NULL;
ret = st_com_handle_announce(ppi, buf, len);
if (ret)
return ret;
if (!bmc_pidcmp(&hdr->sourcePortIdentity,
if (erbest!=NULL && !bmc_pidcmp(&hdr->sourcePortIdentity,
&erbest->sourcePortIdentity)) {
/*
* 9.2.6.11 d) reset timeout when an announce
......
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