All of lore.kernel.org
 help / color / mirror / Atom feed
* tcp port reuse checking TCP_LISTEN state
@ 2004-11-23 10:20 Ilya Pashkovsky
  2004-11-25 16:05 ` Alan Cox
  2004-11-27 14:13 ` Ilya Pashkovsky
  0 siblings, 2 replies; 3+ messages in thread
From: Ilya Pashkovsky @ 2004-11-23 10:20 UTC (permalink / raw)
  To: linux-kernel

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 ?

--
 ilya

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: tcp port reuse checking TCP_LISTEN state
  2004-11-23 10:20 tcp port reuse checking TCP_LISTEN state Ilya Pashkovsky
@ 2004-11-25 16:05 ` Alan Cox
  2004-11-27 14:13 ` Ilya Pashkovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2004-11-25 16:05 UTC (permalink / raw)
  To: Ilya Pashkovsky; +Cc: Linux Kernel Mailing List

On Maw, 2004-11-23 at 10:20, Ilya Pashkovsky wrote:
> 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.

You should probably ask netdev@oss.sgi.com as that is where most
networking developers hang out


^ permalink raw reply	[flat|nested] 3+ messages in thread

* tcp port reuse checking TCP_LISTEN state
  2004-11-23 10:20 tcp port reuse checking TCP_LISTEN state Ilya Pashkovsky
  2004-11-25 16:05 ` Alan Cox
@ 2004-11-27 14:13 ` Ilya Pashkovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Ilya Pashkovsky @ 2004-11-27 14:13 UTC (permalink / raw)
  To: netdev

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@gmail.com

--
ilya

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-27 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-23 10:20 tcp port reuse checking TCP_LISTEN state Ilya Pashkovsky
2004-11-25 16:05 ` Alan Cox
2004-11-27 14:13 ` Ilya Pashkovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.