lkml.org 
[lkml]   [2004]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjecttcp port reuse checking TCP_LISTEN state
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
-
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/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.037 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site