Permalink
Browse files

Fixed compiler problem in checksums that causes ipv6 to totally fail on

  • Loading branch information...
1 parent c9b7a29 commit a5f5d6c74e604fde3dbba059584e63c7591341e9 @maniacbug committed Jul 25, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 core/net/uip6.c
View
11 core/net/uip6.c
@@ -351,12 +351,19 @@ uip_ipchksum(void)
return (sum == 0) ? 0xffff : uip_htons(sum);
}
#endif
+
+#ifdef __AVR__
+#define AVR_VOLATILE volatile
+#else
+#define AVR_VOLATILE
+#endif
+
/*---------------------------------------------------------------------------*/
static u16_t
upper_layer_chksum(u8_t proto)
{
- u16_t upper_layer_len;
- u16_t sum;
+ AVR_VOLATILE u16_t upper_layer_len;
+ AVR_VOLATILE u16_t sum;
upper_layer_len = (((u16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1] - uip_ext_len) ;

0 comments on commit a5f5d6c

Please sign in to comment.