]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Fixed UDP multicast receive filtering (multicast should only be received when bound...
authorgoldsimon <goldsimon@gmx.de>
Fri, 28 Aug 2015 08:24:02 +0000 (10:24 +0200)
committergoldsimon <goldsimon@gmx.de>
Fri, 28 Aug 2015 08:24:02 +0000 (10:24 +0200)
src/core/udp.c

index c902f755e62948cef9ff12e7af29dbd686f4935c..6215c3145d6f533d1dfa4de9038d55f18d52db5d 100644 (file)
@@ -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)))))) {