From 367ac04ed85ea427129dd72ac66c0942b160eb4e Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 28 Aug 2015 10:24:02 +0200 Subject: [PATCH] Fixed UDP multicast receive filtering (multicast should only be received when bound to ANY or the destination multicast address) --- src/core/udp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/udp.c b/src/core/udp.c index c902f755..6215c314 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -258,7 +258,7 @@ udp_input(struct pbuf *p, struct netif *inp) ((!broadcast && ip_addr_isany(&pcb->local_ip)) || ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr()) || #if LWIP_IGMP - ip_addr_ismulticast(ip_current_dest_addr()) || + (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(pcb, SOF_BROADCAST) && @@ -394,7 +394,7 @@ udp_input(struct pbuf *p, struct netif *inp) ((!broadcast && ip_addr_isany(&mpcb->local_ip)) || ip_addr_cmp(&mpcb->local_ip, ip_current_dest_addr()) || #if LWIP_IGMP - ip_addr_ismulticast(ip_current_dest_addr()) || + (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)))))) {