mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-10 11:29:38 +00:00
anti-replay.c: fix undefined behavior on big-endian platforms
This commit is contained in:
parent
7d55e89563
commit
48ae0d2ba0
@ -55,7 +55,8 @@ anti_replay_set_counter(void)
|
|||||||
{
|
{
|
||||||
frame802154_frame_counter_t reordered_counter;
|
frame802154_frame_counter_t reordered_counter;
|
||||||
|
|
||||||
reordered_counter.u32 = LLSEC802154_HTONL(++counter);
|
++counter;
|
||||||
|
reordered_counter.u32 = LLSEC802154_HTONL(counter);
|
||||||
|
|
||||||
packetbuf_set_attr(PACKETBUF_ATTR_FRAME_COUNTER_BYTES_0_1, reordered_counter.u16[0]);
|
packetbuf_set_attr(PACKETBUF_ATTR_FRAME_COUNTER_BYTES_0_1, reordered_counter.u16[0]);
|
||||||
packetbuf_set_attr(PACKETBUF_ATTR_FRAME_COUNTER_BYTES_2_3, reordered_counter.u16[1]);
|
packetbuf_set_attr(PACKETBUF_ATTR_FRAME_COUNTER_BYTES_2_3, reordered_counter.u16[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user