IPv6: #define IPH_PROTO(hdr) (iphdr->nexthdr) to remove #ifdef IPv6 in udp_input()

This commit is contained in:
goldsimon 2007-06-03 18:10:33 +00:00
parent 8fd6a61df6
commit 3639daa329
2 changed files with 2 additions and 4 deletions

View File

@ -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),

View File

@ -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"