From f25856a38742bcdf6f432f73395869e44e1b0e9c Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 18 Oct 2009 22:03:44 +0000 Subject: [PATCH] Hack to be able to receive UDPv4 multicast packets --- core/net/uip.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/net/uip.c b/core/net/uip.c index fda6f98b5..74d470b33 100644 --- a/core/net/uip.c +++ b/core/net/uip.c @@ -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