| To: | netdev@xxxxxxxxxxx |
|---|---|
| Subject: | tcp port reuse checking TCP_LISTEN state |
| From: | Ilya Pashkovsky <ilya.pashkovsky@xxxxxxxxx> |
| Date: | Sat, 27 Nov 2004 16:13:34 +0200 |
| Domainkey-signature: | a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=iuz1XfEWQ376JxttZqder+Kk868dSE4Gys39OiA9LVpSpC4KWJO9MoLECUGqbjlVDprZI3x3og5HlDdNQRUccMTQaeWa/y5tUtFguEU97QtyLtVJ54hnRn+xeRR1j+PkQamQE6/p/mzoEdJyoXIPphSQWu+fUW/4EYTU5xxFoUc= |
| In-reply-to: | <fcb9aa29041123022027c1ec06@xxxxxxxxxxxxxx> |
| References: | <fcb9aa29041123022027c1ec06@xxxxxxxxxxxxxx> |
| Reply-to: | Ilya Pashkovsky <ilya.pashkovsky@xxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
Hello, fellow developers. While BSD (and thus, MacOS X) has the SO_REUSEPORT socket option, and Windows has SO_REUSEADDR socket option that integrates the port reuse functionality, linux tends to differ. Though the socket matching should be made using the tuple consisting of both source address+port and destination address+port, there's a check in the tcp implementation of linux kernel for TCP_LISTEN state, which inhibits port reuse. While its logical to allow only one listener on a socket, this can be accomplished by checking for the socket state during the call to listen(). The current behavior breaks applications that want to both listen on an port and initiate outgoing connections from it (same port). Can anyone please explain the logic behind the TCP_LISTEN check being done on bind() calls and not listen() calls ? p.s. Please cc your reply directly to ilya.pashkovsky@xxxxxxxxx -- ilya |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: pktgen, Lennert Buytenhek |
|---|---|
| Next by Date: | Re: pktgen, Lennert Buytenhek |
| Previous by Thread: | Re: pktgen, Robert Olsson |
| Next by Thread: | Re: SiS900 Bugreport, Daniele Venzano |
| Indexes: | [Date] [Thread] [Top] [All Lists] |