1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

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
This commit is contained in:
Jack Elston 2011-10-04 20:53:34 -05:00 committed by James Snyder
parent 2d484e1ead
commit 7fbfc2c229

View File

@ -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. */