From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
To: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Cc: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Subject: [PATCH 1/2] tcp: fix too short FIN_WAIT2 time out
Date: Tue, 12 Feb 2013 21:52:01 +0900 [thread overview]
Message-ID: <1360673521.10638.12.camel@ubuntu-vm-makita> (raw)
In-Reply-To: <1360673384.10638.10.camel@ubuntu-vm-makita>
When tcp_fin_timeout is between 60 and 120, FIN_WAIT2 socket
disappears in (tcp_fin_timeout - 60) * 2 sec, which is shorter
than expected.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
net/ipv4/tcp_timer.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index b78aac3..c20e474 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -576,12 +576,8 @@ static void tcp_keepalive_timer (unsigned long data)
if (sk->sk_state == TCP_FIN_WAIT2 && sock_flag(sk, SOCK_DEAD)) {
if (tp->linger2 >= 0) {
- const int tmo = tcp_fin_time(sk) - TCP_TIMEWAIT_LEN;
-
- if (tmo > 0) {
- tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
- goto out;
- }
+ tcp_time_wait(sk, TCP_FIN_WAIT2, TCP_TIMEWAIT_LEN);
+ goto out;
}
tcp_send_active_reset(sk, GFP_ATOMIC);
goto death;
--
1.7.1
next prev parent reply other threads:[~2013-02-12 12:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 12:49 [PATCH 0/2] tcp: fix problems when tcp_fin_timeout is greater than 60 Toshiaki Makita
2013-02-12 12:52 ` Toshiaki Makita [this message]
2013-02-12 12:54 ` [PATCH 2/2] tcp: fix FIN_WAIT2 timer expression in /proc/net/tcp Toshiaki Makita
2013-02-12 14:57 ` Eric Dumazet
2013-02-12 15:13 ` Eric Dumazet
2013-02-15 8:26 ` Toshiaki Makita
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=1360673521.10638.12.camel@ubuntu-vm-makita \
--to=makita.toshiaki@lab.ntt.co.jp \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).