mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
IPv6: #define IPH_PROTO(hdr) (iphdr->nexthdr) to remove #ifdef IPv6 in udp_input()
This commit is contained in:
parent
8fd6a61df6
commit
3639daa329
@ -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),
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user