From 0aea1b608ac660b241a735269172b112830747f9 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 22 Sep 2011 06:24:58 +0200 Subject: [PATCH] Corrected fix for bug #34072 (UDP broadcast is received from wrong UDP pcb if udp port matches): pcbs bound to IPADDR_ANY did not receive broadcasts any more (bug #34294) --- src/core/udp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/udp.c b/src/core/udp.c index ff4d6896..04d52b19 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -261,10 +261,12 @@ udp_input(struct pbuf *p, struct netif *inp) #endif /* LWIP_IGMP */ #if IP_SOF_BROADCAST_RECV (broadcast && (pcb->so_options & SOF_BROADCAST) && - ip_addr_netcmp(ipX_2_ip(&pcb->local_ip), ip_current_dest_addr(), &inp->netmask)))))) { + (ipX_addr_isany(0, &pcb->local_ip) || + ip_addr_netcmp(ipX_2_ip(&pcb->local_ip), ip_current_dest_addr(), &inp->netmask))))))) { #else /* IP_SOF_BROADCAST_RECV */ (broadcast && - ip_addr_netcmp(ipX_2_ip(&pcb->local_ip), ip_current_dest_addr(), &inp->netmask)))))) { + (ipX_addr_isany(0, &pcb->local_ip) || + ip_addr_netcmp(ipX_2_ip(&pcb->local_ip), ip_current_dest_addr(), &inp->netmask))))))) { #endif /* IP_SOF_BROADCAST_RECV */ local_match = 1; if ((uncon_pcb == NULL) &&