From c0d6b116d6113c13f269c560930d51c0cea2e915 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Wed, 3 Dec 2014 19:06:00 +0100 Subject: [PATCH] Align packetbuf on an even 32-bit boundary --- core/net/packetbuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/net/packetbuf.c b/core/net/packetbuf.c index 43994f61e42..6e4c3e72025 100644 --- a/core/net/packetbuf.c +++ b/core/net/packetbuf.c @@ -56,10 +56,10 @@ static uint16_t buflen, bufptr; static uint8_t hdrptr; /* The declarations below ensure that the packet buffer is aligned on - an even 16-bit boundary. On some platforms (most notably the - msp430), having apotentially misaligned packet buffer may lead to - problems when accessing 16-bit values. */ -static uint16_t packetbuf_aligned[(PACKETBUF_SIZE + PACKETBUF_HDR_SIZE) / 2 + 1]; + an even 32-bit boundary. On some platforms (most notably the + msp430 or OpenRISC), having a potentially misaligned packet buffer may lead to + problems when accessing words. */ +static uint32_t packetbuf_aligned[(PACKETBUF_SIZE + PACKETBUF_HDR_SIZE + 3) / 4]; static uint8_t *packetbuf = (uint8_t *)packetbuf_aligned; static uint8_t *packetbufptr;