diff --git a/src/core/udp.c b/src/core/udp.c index b15c9af9..47a224b3 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -178,11 +178,7 @@ udp_input(struct pbuf *p, struct netif *inp) /* Check checksum if this is a match or if it was directed at us. */ if (pcb != NULL || ip_addr_cmp(&inp->ip_addr, &iphdr->dest)) { LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: calculating checksum\n")); -#ifdef IPv6 - if (iphdr->nexthdr == IP_PROTO_UDPLITE) { -#else if (IPH_PROTO(iphdr) == IP_PROTO_UDPLITE) { -#endif /* IPv4 */ /* Do the UDP Lite checksum */ #if CHECKSUM_CHECK_UDP if (inet_chksum_pseudo(p, (struct ip_addr *)&(iphdr->src), diff --git a/src/include/ipv6/lwip/ip.h b/src/include/ipv6/lwip/ip.h index 8b4301b6..3849781f 100644 --- a/src/include/ipv6/lwip/ip.h +++ b/src/include/ipv6/lwip/ip.h @@ -88,6 +88,8 @@ struct ip_hdr { struct ip_addr src, dest; /* source and destination IP addresses */ }; +#define IPH_PROTO(hdr) (iphdr->nexthdr) + void ip_init(void); #include "lwip/netif.h"