I'm implementing a UDP echo server in raw mode on an ML605 board. When I receive a UDP packet my receive function is called, I can see the received data, and I try to send data back out to the ip address and port I received from. Here's my code:
The problem is that after the udp_sendto function is called, instead of sending out a UDP packet the FPGA sends a gratuitous ARP request. When I try udp_send instead of udp_sendto it sends the correct packet out, but it broadcasts it to port 0 (I had assumed it would send it to the initiator of the packet the recv function was called to handle).
FYI - udp_send works when you set the remote_ip and remote_port on the PCB to the value at addr and the value of port, respectively. The fact that my code below doesn't work is looking more and more like a bug.
Message Edited by jonathan.ross on 12-10-2009 08:32 AM