Merge pull request #860 from simonduq/frame802154-align

frame802154_t: make sure dest_addr and src_addr are aligned
This commit is contained in:
Nicolas Tsiftes 2014-11-18 08:59:30 +01:00
commit 866bb99944
3 changed files with 7 additions and 3 deletions

View File

@ -66,6 +66,7 @@
#include "sys/cc.h"
#include "net/mac/frame802154.h"
#include "net/llsec/llsec802154.h"
#include "net/linkaddr.h"
#include <string.h>
/**

View File

@ -67,7 +67,6 @@
#define FRAME_802154_H
#include "contiki-conf.h"
#include "net/linkaddr.h"
#ifdef IEEE802154_CONF_PANID
#define IEEE802154_PANID IEEE802154_CONF_PANID
@ -174,12 +173,15 @@ typedef struct {
* specification for details.
*/
typedef struct {
/* The fields dest_addr and src_addr must come first to ensure they are aligned to the
* CPU word size. Needed as they are accessed directly as linkaddr_t*. Note we cannot use
* the type linkaddr_t directly here, as we always need 8 bytes, not LINKADDR_SIZE bytes. */
uint8_t dest_addr[8]; /**< Destination address */
uint8_t src_addr[8]; /**< Source address */
frame802154_fcf_t fcf; /**< Frame control field */
uint8_t seq; /**< Sequence number */
uint16_t dest_pid; /**< Destination PAN ID */
uint8_t dest_addr[8]; /**< Destination address */
uint16_t src_pid; /**< Source PAN ID */
uint8_t src_addr[8]; /**< Source address */
frame802154_aux_hdr_t aux_hdr; /**< Aux security header */
uint8_t *payload; /**< Pointer to 802.15.4 payload */
int payload_len; /**< Length of payload field */

View File

@ -49,6 +49,7 @@
#include "dev/leds.h"
#include "net/netstack.h"
#include "net/mac/frame802154.h"
#include "net/linkaddr.h"
#include "dev/ds2401.h"
#include "sys/node-id.h"