From: Ilya Pashkovsky <ilya.pashkovsky@gmail.com>
To: davem@redhat.com, netdev@oss.sgi.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fixed patch for sk_reuse
Date: Wed, 8 Dec 2004 15:12:59 +0200 [thread overview]
Message-ID: <fcb9aa2904120805126204ef1f@mail.gmail.com> (raw)
ah, it seems the sk_reuse > 1 is really used...
do not try the previous patch.
http://puding.mine.nu/patches/patch-reuse
--- linux/net/ipv4/tcp_ipv4.c.orig2004-12-07 14:54:12.597084704 +0200
+++ linux/net/ipv4/tcp_ipv4.c2004-12-08 15:07:51.985722208 +0200
@@ -50,6 +50,7 @@
*YOSHIFUJI Hideaki @USAGI and:Support IPV6_V6ONLY socket option, which
*Alexey Kuznetsovallow both IPv4 and IPv6 sockets to bind
*a single port at the same time.
+ *Ilya Pashkovsky:fix TCP_LISTEN check on reuse
*/
#include <linux/config.h>
@@ -184,7 +185,8 @@ static inline int tcp_bind_conflict(stru
const u32 sk_rcv_saddr = tcp_v4_rcv_saddr(sk);
struct sock *sk2;
struct hlist_node *node;
-int reuse = sk->sk_reuse;
+unsigned char reuse = sk->sk_reuse;
+unsigned char state = sk->sk_state;
sk_for_each_bound(sk2, node, &tb->owners) {
if (sk != sk2 &&
@@ -193,7 +195,7 @@ static inline int tcp_bind_conflict(stru
!sk2->sk_bound_dev_if ||
sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
if (!reuse || !sk2->sk_reuse ||
- sk2->sk_state == TCP_LISTEN) {
+ (state == TCP_LISTEN && sk2->sk_state == TCP_LISTEN)) {
const u32 sk2_rcv_saddr = tcp_v4_rcv_saddr(sk2);
if (!sk2_rcv_saddr || !sk_rcv_saddr ||
sk2_rcv_saddr == sk_rcv_saddr)
reply other threads:[~2004-12-08 13:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=fcb9aa2904120805126204ef1f@mail.gmail.com \
--to=ilya.pashkovsky@gmail.com \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--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).