Hack to be able to receive UDPv4 multicast packets

This commit is contained in:
adamdunkels 2009-10-18 22:03:44 +00:00
parent fb037e0afb
commit f25856a387

View File

@ -41,7 +41,7 @@
* *
* This file is part of the uIP TCP/IP stack. * This file is part of the uIP TCP/IP stack.
* *
* $Id: uip.c,v 1.15 2008/10/15 08:08:32 adamdunkels Exp $ * $Id: uip.c,v 1.16 2009/10/18 22:03:44 adamdunkels Exp $
* *
*/ */
@ -903,9 +903,16 @@ uip_process(u8_t flag)
#if UIP_BROADCAST #if UIP_BROADCAST
DEBUG_PRINTF("UDP IP checksum 0x%04x\n", uip_ipchksum()); DEBUG_PRINTF("UDP IP checksum 0x%04x\n", uip_ipchksum());
if(BUF->proto == UIP_PROTO_UDP && if(BUF->proto == UIP_PROTO_UDP &&
uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr) (uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr) ||
/*&& (BUF->destipaddr.u8[0] & 224) == 224)) { /* XXX this is a
uip_ipchksum() == 0xffff*/) { hack to be able
to receive UDP
multicast
packets. We check
for the bit
pattern of the
multicast
prefix. */
goto udp_input; goto udp_input;
} }
#endif /* UIP_BROADCAST */ #endif /* UIP_BROADCAST */