From 3639daa3299d4b9915369ef129381424fad11980 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 3 Jun 2007 18:10:33 +0000 Subject: [PATCH] IPv6: #define IPH_PROTO(hdr) (iphdr->nexthdr) to remove #ifdef IPv6 in udp_input() --- src/core/udp.c | 4 ---- src/include/ipv6/lwip/ip.h | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) 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"