diff --git a/os/net/ipv6/uip.h b/os/net/ipv6/uip.h index 255eeb1a5..35f0d9cfd 100755 --- a/os/net/ipv6/uip.h +++ b/os/net/ipv6/uip.h @@ -84,10 +84,11 @@ /** * Direct access to ICMP, UDP, and TCP headers and payload */ -#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len]) +#define UIP_IP_PAYLOAD ((unsigned char *)&uip_buf[uip_l2_l3_hdr_len]) +#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)UIP_IP_PAYLOAD) #define UIP_ICMP_PAYLOAD ((unsigned char *)&uip_buf[uip_l2_l3_icmp_hdr_len]) -#define UIP_UDP_BUF ((struct uip_udp_hdr *)&uip_buf[uip_l2_l3_hdr_len]) -#define UIP_TCP_BUF ((struct uip_tcp_hdr *)&uip_buf[uip_l2_l3_hdr_len]) +#define UIP_UDP_BUF ((struct uip_udp_hdr *)UIP_IP_PAYLOAD) +#define UIP_TCP_BUF ((struct uip_tcp_hdr *)UIP_IP_PAYLOAD) #include "net/ipv6/uipopt.h" #include "net/ipv6/uipbuf.h"