anti-replay.c: fix undefined behavior on big-endian platforms

This commit is contained in:
Simon Duquennoy 2015-10-05 15:19:27 +02:00
parent 7d55e89563
commit 48ae0d2ba0

View file

@ -55,7 +55,8 @@ anti_replay_set_counter(void)
{
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_2_3, reordered_counter.u16[1]);