Re: Possible bug with UDP and SO_REUSEADDR.

From: David Schwartz (davids@webmaster.com)
Date: Sun Apr 28 2002 - 19:41:52 EST


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 30 2002 - 22:00:16 EST