When receiving MD UDP notify message, looks like occasionally message is dropped at trdp_mdHandleRequest(), code snapshot below.
trdp_mdcom.c
trdp_mdHandleRequest()
for ( iterMD = appHandle->pMDRcvQueue; iterMD != NULL; iterMD = iterMD->pNext )
{
numOfReceivers++; /* count the list items here */
if ( 0 == memcmp(iterMD->pPacket->frameHead.sessionID, pH->sessionID, TRDP_SESS_ID_SIZE))
/* KK-PROPOSAL: COULD THIS HAVE ANOTHER CONDITION, ONLY IF sessionID != 0 */
{
/* According IEC61375-2-3 A.7.7.1 */
/* encountered a matching session */
if ((pH->sequenceCounter == iterMD->pPacket->frameHead.sequenceCounter)
||
(isTCP == TRUE) /* include TCP as topmost discard criterium */
||
(iterMD->addr.mcGroup != 0)) /* discard multicasts anyway */
{
Best regards, Kari
MD notification have their sessionId set to zero, thus the if-clause will always evaluate to false. By additionally comparing to pH->sessionID[16] with all zeros we will not gain much, I assume. But I also don't understand where and why notifications are dropped? Do you have any logs? Are there possibly receivers with sessionID==0?
In our use case multiple MD notifications (each with different content) are sometimes sent in sequence and this seems to cause the issue. I think the problem happens when old session with sessionId=0 exist, for example:
Snapshot from logs below.
[90158.893] Received UDP MD packet (type: 'Mn' UUID: 0000000000000000 Data len: 21) at trdp_mdcom.c, line 2019
[90158.893] Creating UDP MD replier session '0000000000000000' at trdp_mdcom.c, line 1745
[90158.893] vos_memAlloc() 0x7f44ef6c09e8, size 264 at vos_mem.c, line 479
[90158.893] vos_memAlloc() 0x7f44ef6c0bf8, size 1480 at vos_mem.c, line 479
[90158.893] Received UDP MD packet (type: 'Mn' UUID: 0000000000000000 Data len: 23) at trdp_mdcom.c, line 2019
[90158.893] trdp_mdRecv: Repeated request discarded! at trdp_mdcom.c, line 1577
[90158.894] Freeing MD UDP replier session '0000000000000000' at trdp_mdcom.c, line 765
Couldn't replicate your error, but excluded the for-loop searching for existing sessions in case of notifications.
Just tested trunk-code, I'm afraid the fix doesn't work, some notifications are still dropped.
Of course, you're right. TRDP_ST_RX_NOTIFY_RECEIVED is the state...
Just tested current trunk, looks good.
This ticket can be closed.