From 7fbfc2c229faa471c48eb75e4216d6261f705861 Mon Sep 17 00:00:00 2001 From: Jack Elston Date: Tue, 4 Oct 2011 20:53:34 -0500 Subject: [PATCH] UDP packet data pointed at wrong location I have been working on implementing a port to the atmel ATMega128 and I have noticed that sending UDP packets does not work (the transferred data is always 0). A look into the code reveals that in uip.c, the address of uip_appdata gets set incorrectly. Somewhere around line 1159 the code needs to be changed: --- uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPTCPH_LEN]; +++ uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; http://article.gmane.org/gmane.network.uip.user/68 --- src/uip/uip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uip/uip.c b/src/uip/uip.c index 9880d836..3706a7f6 100644 --- a/src/uip/uip.c +++ b/src/uip/uip.c @@ -1232,7 +1232,7 @@ uip_process(u8_t flag) uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr); uip_ipaddr_copy(BUF->destipaddr, uip_udp_conn->ripaddr); - uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPTCPH_LEN]; + uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; #if UIP_UDP_CHECKSUMS /* Calculate UDP checksum. */