Hi
I'm just starting to implement UDP on my OS, and I think I understand it correctly, I am just wondering what happens to the packets who are from addresses you don't recv_from. Does the tcp/ip stack just time them out and delete them after a little while? Or retain them in case you do a recv_from for that address later on? I imagine you wouldn't normally get random packets from internet addresses unless you were a server and expecting them or a client and someone was trying to do something sinister?
thanks..
Implementing UDP
Re: Implementing UDP
Either there is a listening application for this pair "destination address, port" and packet is added to queue (and dropped if there's no space left) or it's dropped immediately (if there's no such queue).
Re: Implementing UDP
Ok, thanks. I misunderstood recvfrom, I thought it only returned packets for a specific address, but it seems to return packets from any address with the address. So the application deals with packets from addresses it doesn't want.