allocate uip_buf as uint32_t to avoid risk for unaligned uip_buf on 32 or 16 bit architectures

This commit is contained in:
joxe 2010-05-04 09:19:41 +00:00
parent cc55197d52
commit 790819e701
3 changed files with 8 additions and 6 deletions

View file

@ -41,7 +41,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip.c,v 1.23 2010/02/15 23:31:05 adamdunkels Exp $
* $Id: uip.c,v 1.24 2010/05/04 09:19:41 joxe Exp $
*
*/
@ -127,7 +127,8 @@ struct uip_eth_addr uip_ethaddr = {{0,0,0,0,0,0}};
#endif
#ifndef UIP_CONF_EXTERNAL_BUFFER
u8_t uip_buf[UIP_BUFSIZE + 2]; /* The packet buffer that contains
static uint32_t uip_buf32[(UIP_BUFSIZE + 3) / 4];
uint8_t *uip_buf = (uint8_t *)uip_buf32; /* The packet buffer that contains
incoming packets. */
#endif /* UIP_CONF_EXTERNAL_BUFFER */

View file

@ -47,7 +47,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip.h,v 1.29 2010/04/06 16:47:18 nvt-se Exp $
* $Id: uip.h,v 1.30 2010/05/04 09:19:41 joxe Exp $
*
*/
@ -476,7 +476,7 @@ void uip_reass_over(void);
}
\endcode
*/
CCIF extern u8_t uip_buf[UIP_BUFSIZE+2];
CCIF extern uint8_t *uip_buf;

View file

@ -41,7 +41,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip6.c,v 1.19 2010/04/30 13:22:21 joxe Exp $
* $Id: uip6.c,v 1.20 2010/05/04 09:19:41 joxe Exp $
*
*/
@ -170,7 +170,8 @@ u8_t uip_ext_opt_offset = 0;
*/
/** Packet buffer for incoming and outgoing packets */
#ifndef UIP_CONF_EXTERNAL_BUFFER
u8_t uip_buf[UIP_BUFSIZE + 2];
static uint32_t uip_buf32[(UIP_BUFSIZE + 3) / 4];
uint8_t *uip_buf = (uint8_t *) uip_buf32;
#endif /* UIP_CONF_EXTERNAL_BUFFER */
/* The uip_appdata pointer points to application data. */