Skip to content

Commit

Permalink
sdk: packDev_t: Properly and entirely fill entire struct
Browse files Browse the repository at this point in the history
The values from associated_devices_t struct after linkInfo.txFailure were
not written to the buffer at all (without the proper pointer increment, they
would have been written to the wrong spot anyway). So this part of the buffer
also contained uninitialized memory only. I completed the function to copy
the entire struct, because the endDev.deviceTimeout and timeoutCounter were
particularly interesting for me to inspect child aging.

See Koenkk/zigbee2mqtt#13478 (comment)

@slugzero

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
  • Loading branch information
oliv3r committed Aug 14, 2024
1 parent 155da8f commit 929884d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/ti/zstack/mt/mt_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,10 +1547,17 @@ static void packDev_t(uint8_t *pBuf, associated_devices_t *pDev)
*pBuf++ = pDev->linkInfo.txCost;
*pBuf++ = pDev->linkInfo.rxLqi;
*pBuf++ = pDev->linkInfo.inKeySeqNum;
OsalPort_bufferUint32( pBuf, pDev->linkInfo.inFrmCntr );
OsalPort_bufferUint32(pBuf, pDev->linkInfo.inFrmCntr);
pBuf += 4;
*pBuf++ = LO_UINT16(pDev->linkInfo.txFailure);
*pBuf++ = HI_UINT16(pDev->linkInfo.txFailure);
*pBuf++ = pDev->endDev.endDevCfg;
OsalPort_bufferUint32(pBuf, pDev->endDev.deviceTimeout);
pBuf += 4;
OsalPort_bufferUint32(pBuf, pDev->timeoutCounter);
pBuf += 4;
*pBuf++ = pDev->keepaliveRcv;
*pBuf++ = pDev->ctrl;
}
}

Expand Down

0 comments on commit 929884d

Please sign in to comment.