Commit d444b632 authored by Davide Ciminaghi's avatar Davide Ciminaghi Committed by Alessandro Rubini

compliance, 9.5.2.2: ignore messages received from same port that sent them

parent c4868336
...@@ -55,15 +55,12 @@ int msg_unpack_header(struct pp_instance *ppi, void *buf, int plen) ...@@ -55,15 +55,12 @@ int msg_unpack_header(struct pp_instance *ppi, void *buf, int plen)
return -1; return -1;
/* /*
* If the message is from us, we should discard it. * If the message is from the same port that sent it, we should
* The best way to do that is comparing the mac address, * discard it (9.5.2.2)
* but it's easier to check the clock identity (we refuse
* any port, not only the same port, as we can't sync with
* ourself even when we'll run in multi-port mode.
*/ */
if (!memcmp(&ppi->received_ptp_header.sourcePortIdentity.clockIdentity, if (!memcmp(&ppi->received_ptp_header.sourcePortIdentity,
&DSPOR(ppi)->portIdentity.clockIdentity, &DSPOR(ppi)->portIdentity,
PP_CLOCK_IDENTITY_LENGTH)) sizeof(PortIdentity)))
return -1; return -1;
/* /*
......
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