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 16, 2024
1 parent c91c9e6 commit 46e0902
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/ti/zstack/mt/mt_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,13 @@ static void packDev_t(uint8_t *pBuf, associated_devices_t *pDev)
pBuf += 4;
*pBuf++ = LO_UINT16(pDev->linkInfo.txFailure);
*pBuf++ = HI_UINT16(pDev->linkInfo.txFailure);
*pBuf++ = pDev->endDev.endDevCfg;^M
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 46e0902

Please sign in to comment.