Free (GPLv2) TCP/IP stack developed by TASS Belgium
Issue: UDPSocket.recvfrom() returns 0 instead of "Destination unreachable" error (Closed: Fixed)
receivefrom has a blocking behaviour. If the receive buffer is empty it blocks until an UDP packet is received. We discovered a case where a call to receivefrom immediately returned with zero received bytes without waiting for a packet to arrive. This happens with the following sequence. Every packet is send/received from the same socket:
receivefrom() pico <--- UDP, data="hello" --- we receivefrom returns with 5 bytes sendto("hello") pico --- UDP, data="hello" ---> we pico <--- ICMP port unreach --- we receivefrom() receivefrom returns with 0 bytes receivefrom() receivefrom returns with 0 bytes ...
The ICMP port unreach triggers this strange behaviour. If you leave it out, receivefrom behaves normal.