|
45 | 45 |
|
46 | 46 | /* Openthread general */
|
47 | 47 | #include "openthread-system.h"
|
48 |
| - |
| 48 | +#include <utils/encoding.h> |
49 | 49 | #include <utils/code_utils.h>
|
50 | 50 | #include <utils/mac_frame.h>
|
51 | 51 | #include "utils/link_metrics.h"
|
@@ -660,15 +660,13 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
660 | 660 | tmp.m8[i] = aExtAddress->m8[sizeof(*aExtAddress) - 1 - i];
|
661 | 661 | }
|
662 | 662 |
|
663 |
| - uint32_t v1 = *(uint32_t *)tmp.m8; |
664 |
| - uint32_t v2 = *(uint32_t *)(tmp.m8 + sizeof(uint32_t)); |
| 663 | + uint64_t v = otEncodingReadUint64Le(tmp.m8); |
665 | 664 |
|
666 | 665 | for (; idx < MAX_FP_ADDRS; idx++)
|
667 | 666 | {
|
668 |
| - uint32_t t1 = *(uint32_t *)sFpExtAddr[idx].extAddr.m8; |
669 |
| - uint32_t t2 = *(uint32_t *)(sFpExtAddr[idx].extAddr.m8 + sizeof(uint32_t)); |
| 667 | + uint64_t t = otEncodingReadUint64Le(sFpExtAddr[idx].extAddr.m8); |
670 | 668 |
|
671 |
| - if (BIT_TST(sFpExtAddrMask, idx) && (t1 == v1) && (t2 == v2)) |
| 669 | + if (BIT_TST(sFpExtAddrMask, idx) && (t == v)) |
672 | 670 | {
|
673 | 671 | BIT_CLR(sFpExtAddrMask, idx);
|
674 | 672 | error = OT_ERROR_NONE;
|
@@ -1183,15 +1181,13 @@ static bool K32WCheckIfFpRequired(tsPhyFrame *aRxFrame)
|
1183 | 1181 | else if (srcAddr.mType == OT_MAC_ADDRESS_TYPE_EXTENDED)
|
1184 | 1182 | {
|
1185 | 1183 | /* srcAddr.mAddress.mExtAddress is returned in reverse order (big endian) */
|
1186 |
| - uint32_t v1 = *(uint32_t *)srcAddr.mAddress.mExtAddress.m8; |
1187 |
| - uint32_t v2 = *(uint32_t *)(srcAddr.mAddress.mExtAddress.m8 + sizeof(uint32_t)); |
| 1184 | + uint64_t v = otEncodingReadUint64Le(srcAddr.mAddress.mExtAddress.m8); |
1188 | 1185 |
|
1189 | 1186 | for (idx = 0; idx < MAX_FP_ADDRS; idx++)
|
1190 | 1187 | {
|
1191 |
| - uint32_t t1 = *(uint32_t *)sFpExtAddr[idx].extAddr.m8; |
1192 |
| - uint32_t t2 = *(uint32_t *)(sFpExtAddr[idx].extAddr.m8 + sizeof(uint32_t)); |
| 1188 | + uint64_t t = otEncodingReadUint64Le(sFpExtAddr[idx].extAddr.m8); |
1193 | 1189 |
|
1194 |
| - if (BIT_TST(sFpExtAddrMask, idx) && (t1 == v1) && (t2 == v2)) |
| 1190 | + if (BIT_TST(sFpExtAddrMask, idx) && (t == v)) |
1195 | 1191 | {
|
1196 | 1192 | isFpRequired = TRUE;
|
1197 | 1193 | break;
|
|
0 commit comments