From: Ilya Pashkovsky <ilya.pashkovsky@gmail.com>
To: netdev@oss.sgi.com
Subject: tcp port reuse checking TCP_LISTEN state
Date: Sat, 27 Nov 2004 16:13:34 +0200 [thread overview]
Message-ID: <fcb9aa2904112706135928497@mail.gmail.com> (raw)
In-Reply-To: <fcb9aa29041123022027c1ec06@mail.gmail.com>
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
parent reply other threads:[~2004-11-27 14:13 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <fcb9aa29041123022027c1ec06@mail.gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fcb9aa2904112706135928497@mail.gmail.com \
--to=ilya.pashkovsky@gmail.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).