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.
*
* $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
DEBUG_PRINTF("UDP IP checksum 0x%04x\n", uip_ipchksum());
if(BUF->proto == UIP_PROTO_UDP &&
uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr)
/*&&
uip_ipchksum() == 0xffff*/) {
(uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr) ||
(BUF->destipaddr.u8[0] & 224) == 224)) { /* XXX this is a
hack to be able
to receive UDP
multicast
packets. We check
for the bit
pattern of the
multicast
prefix. */
goto udp_input;
}
#endif /* UIP_BROADCAST */
@ -1814,7 +1821,7 @@ uip_process(u8_t flag)
to set the appropriate TCP sequence numbers in the TCP header. */
tcp_send_ack:
BUF->flags = TCP_ACK;
tcp_send_nodata:
uip_len = UIP_IPTCPH_LEN;
@ -1852,7 +1859,7 @@ uip_process(u8_t flag)
BUF->wnd[0] = ((UIP_RECEIVE_WINDOW) >> 8);
BUF->wnd[1] = ((UIP_RECEIVE_WINDOW) & 0xff);
}
tcp_send_noconn:
BUF->ttl = UIP_TTL;
#if UIP_CONF_IPV6