Changed to use LINKADDR_SIZE instead of sizeof() to select between
short address and long address as some platforms might use padding in the struct. This fixes #555.
This commit is contained in:
parent
dbb8f3ec13
commit
b1335b08a8
2 changed files with 3 additions and 3 deletions
|
@ -128,7 +128,7 @@ create(void)
|
|||
\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 {
|
||||
|
@ -150,7 +150,7 @@ create(void)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue