From f36adac8ab018aad8a36e23e7f2a9ba713a7099f Mon Sep 17 00:00:00 2001 From: sg Date: Wed, 23 Sep 2015 22:07:14 +0200 Subject: [PATCH] fixed compiling udp.c for IPv6-only --- src/core/udp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/core/udp.c b/src/core/udp.c index 1c7411bc..f2f3d15b 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -374,7 +374,10 @@ udp_input(struct pbuf *p, struct netif *inp) if (pcb != NULL) { MIB2_STATS_INC(mib2.udpindatagrams); #if SO_REUSE && SO_REUSE_RXTOALL - if ((broadcast || + if (( +#if LWIP_IPV4 + broadcast || +#endif /* LWIP_IPV4 */ #if LWIP_IPV6 ip6_addr_ismulticast(ip6_current_dest_addr()) || #endif /* LWIP_IPV6 */ @@ -397,13 +400,21 @@ udp_input(struct pbuf *p, struct netif *inp) #else /* LWIP_IPV6 */ (( #endif /* LWIP_IPV6 */ - ((!broadcast && ip_addr_isany(&mpcb->local_ip)) || + (( +#if LWIP_IPV4 + !broadcast && +#endif /* LWIP_IPV4 */ + ip_addr_isany(&mpcb->local_ip)) || ip_addr_cmp(&mpcb->local_ip, ip_current_dest_addr()) || #if LWIP_IGMP (ip_addr_isany(&pcb->local_ip) && ip_addr_ismulticast(ip_current_dest_addr())) || #endif /* LWIP_IGMP */ #if IP_SOF_BROADCAST_RECV - (broadcast && ip_get_option(mpcb, SOF_BROADCAST)))))) { + ( +#if LWIP_IPV4 + broadcast && +#endif /* LWIP_IPV4 */ + ip_get_option(mpcb, SOF_BROADCAST)))))) { #else /* IP_SOF_BROADCAST_RECV */ (broadcast))))) { #endif /* IP_SOF_BROADCAST_RECV */