diff --git a/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_crypto.c b/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_crypto.c index 535a483155..4eb439f4eb 100644 --- a/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_crypto.c +++ b/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_crypto.c @@ -67,7 +67,7 @@ void gnrc_lorawan_calculate_mic(const le_uint32_t *dev_addr, uint32_t fcnt, memcpy(&block.dev_addr, dev_addr, sizeof(le_uint32_t)); - block.fcnt = byteorder_btoll(byteorder_htonl(fcnt)); + block.fcnt = byteorder_htoll(fcnt); block.u32_pad = 0; @@ -103,7 +103,7 @@ void gnrc_lorawan_encrypt_payload(iolist_t *iolist, const le_uint32_t *dev_addr, block->dir = dir & DIR_MASK; block->dev_addr = *dev_addr; - block->fcnt = byteorder_btoll(byteorder_htonl(fcnt)); + block->fcnt = byteorder_htoll(fcnt); block->u32_pad = 0; diff --git a/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_mcps.c b/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_mcps.c index 09f55f4bf5..eb335f5ecf 100644 --- a/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_mcps.c +++ b/sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_mcps.c @@ -221,7 +221,7 @@ size_t gnrc_lorawan_build_hdr(uint8_t mtype, le_uint32_t *dev_addr, lorawan_hdr_set_ack(lw_hdr, ack); lorawan_hdr_set_frame_opts_len(lw_hdr, fopts_length); - lw_hdr->fcnt = byteorder_btols(byteorder_htons(fcnt)); + lw_hdr->fcnt = byteorder_htols(fcnt); buf->index += sizeof(lorawan_hdr_t); @@ -248,7 +248,7 @@ size_t gnrc_lorawan_build_uplink(gnrc_lorawan_t *mac, iolist_t *payload, lorawan_hdr_set_ack(lw_hdr, mac->mcps.ack_requested); - lw_hdr->fcnt = byteorder_btols(byteorder_htons(mac->mcps.fcnt)); + lw_hdr->fcnt = byteorder_htols(mac->mcps.fcnt); buf.index += sizeof(lorawan_hdr_t);