Ignore delay_resp messages from foreign masters.
When a new master appears, it will start to respond to our delay_req messages. Make sure we process only responses from our current master before switching to the new master. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>master
parent
45493756f8
commit
ea4201298c
4
port.c
4
port.c
|
@ -1486,10 +1486,12 @@ static void process_delay_resp(struct port *p, struct ptp_message *m)
|
||||||
{
|
{
|
||||||
struct delay_req_msg *req;
|
struct delay_req_msg *req;
|
||||||
struct delay_resp_msg *rsp = &m->delay_resp;
|
struct delay_resp_msg *rsp = &m->delay_resp;
|
||||||
|
struct PortIdentity master;
|
||||||
|
|
||||||
if (!p->delay_req)
|
if (!p->delay_req)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
master = clock_parent_identity(p->clock);
|
||||||
req = &p->delay_req->delay_req;
|
req = &p->delay_req->delay_req;
|
||||||
|
|
||||||
if (p->state != PS_UNCALIBRATED && p->state != PS_SLAVE)
|
if (p->state != PS_UNCALIBRATED && p->state != PS_SLAVE)
|
||||||
|
@ -1498,6 +1500,8 @@ static void process_delay_resp(struct port *p, struct ptp_message *m)
|
||||||
return;
|
return;
|
||||||
if (rsp->hdr.sequenceId != ntohs(req->hdr.sequenceId))
|
if (rsp->hdr.sequenceId != ntohs(req->hdr.sequenceId))
|
||||||
return;
|
return;
|
||||||
|
if (!pid_eq(&master, &m->header.sourcePortIdentity))
|
||||||
|
return;
|
||||||
|
|
||||||
clock_path_delay(p->clock, p->delay_req->hwts.ts, m->ts.pdu,
|
clock_path_delay(p->clock, p->delay_req->hwts.ts, m->ts.pdu,
|
||||||
m->header.correction);
|
m->header.correction);
|
||||||
|
|
Loading…
Reference in New Issue