Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#23 incorrect in handlePDelayResp()

closed
nobody
None
5
2012-01-04
2011-06-27
Anonymous
No

I thank there is something incorrect in a if statement :
if (!((ptpClock->sentPDelayReqSequenceId == header->sequenceId) &&
(!memcmp(ptpClock->portIdentity.clockIdentity,ptpClock->msgTmp.presp.requestingPortIdentity.clockIdentity,CLOCK_IDENTITY_LENGTH))
&& ( ptpClock->portIdentity.portNumber == ptpClock->msgTmp.presp.requestingPortIdentity.portNumber)))
this statement is used to see if the current peer delay response message is the request one ,why should it put a '!' at the beginng,,and the sequenceID part is not correct to .
I thank it should be :
if ((((ptpClock->sentPDelayReqSequenceId-1) == header->sequenceId) &&
(!memcmp(ptpClock->portIdentity.clockIdentity,ptpClock->msgTmp.presp.requestingPortIdentity.clockIdentity,CLOCK_IDENTITY_LENGTH))
&& ( ptpClock->portIdentity.portNumber == ptpClock->msgTmp.presp.requestingPortIdentity.portNumber)))

Discussion

    • status: open --> closed-duplicate