diff --git a/core/net/mac/framer-802154.c b/core/net/mac/framer-802154.c index c7e4b50c2..a0aea598b 100644 --- a/core/net/mac/framer-802154.c +++ b/core/net/mac/framer-802154.c @@ -132,7 +132,7 @@ create_frame(int type, int do_create) \todo For phase 1 the addresses are all long. We'll need a mechanism in the rime attributes to tell the mac to use long or short for phase 2. */ - if(sizeof(linkaddr_t) == 2) { + if(LINKADDR_SIZE == 2) { /* Use short address mode if linkaddr size is short. */ params.fcf.src_addr_mode = FRAME802154_SHORTADDRMODE; } else { @@ -154,7 +154,7 @@ create_frame(int type, int do_create) linkaddr_copy((linkaddr_t *)¶ms.dest_addr, packetbuf_addr(PACKETBUF_ADDR_RECEIVER)); /* Use short address mode if linkaddr size is small */ - if(sizeof(linkaddr_t) == 2) { + if(LINKADDR_SIZE == 2) { params.fcf.dest_addr_mode = FRAME802154_SHORTADDRMODE; } else { params.fcf.dest_addr_mode = FRAME802154_LONGADDRMODE; diff --git a/core/net/packetbuf.h b/core/net/packetbuf.h index fe2c1dae3..ab84da8fe 100644 --- a/core/net/packetbuf.h +++ b/core/net/packetbuf.h @@ -434,7 +434,7 @@ void packetbuf_attr_copyfrom(struct packetbuf_attr *attrs, #define PACKETBUF_ATTR_BIT 1 #define PACKETBUF_ATTR_BYTE 8 -#define PACKETBUF_ADDRSIZE (sizeof(linkaddr_t) * PACKETBUF_ATTR_BYTE) +#define PACKETBUF_ADDRSIZE (LINKADDR_SIZE * PACKETBUF_ATTR_BYTE) struct packetbuf_attrlist { uint8_t type;