Re: Possible bug with UDP and SO_REUSEADDR.

David Schwartz
2002-04-29T00:41:59Z

On Thu, 25 Apr 2002 19:43:01 -0700 (PDT), David S. Miller wrote:
>From: Terje Eggestad <terje.eggestad@scali.com>
>Date: 25 Apr 2002 14:37:44 +0200
>
>However writing a test server that stand in blocking wait on a UDP
>socket, and start two instances of the server it's ALWAYS the server
>last started that get the udp message, even if it's not in blocking
>wait, and the first started server is.
>
>Smells like a bug to me, this behavior don't make much sence.
>
>Using stock 2.4.17.
>
>Can you post your test server/client application so that I
>don't have to write it myself and guess how you did things?

There are really two possibilities:

1) The two instances are cooperating closely together and should be sharing
a socket (not each opening one), or

2) The two instances are not cooperating closely together and each own their
own socket. For all the kernel knows, they don't even know about each other.

In the first case, it's logical for whichever one happens to try to read
first to get the/a datagram. In the second case, it's logical for the kernel
to pick one and give it all the data.

DS