From: David Miller <davem@davemloft.net>
To: gfree.wind@foxmail.com
Cc: kuznet@ms2.inr.ac.ru, jmorris@namei.org, kaber@trash.net,
ncardwell@google.com, netdev@vger.kernel.org, fgao@ikuai8.com
Subject: Re: [PATCH net 1/1] net: tcp: Increase TCPABORTONLINGER when send RST by linger2 in keepalive timer
Date: Wed, 12 Apr 2017 13:20:49 -0400 (EDT) [thread overview]
Message-ID: <20170412.132049.1340057228980086886.davem@davemloft.net> (raw)
In-Reply-To: <1491741881-28322-1-git-send-email-gfree.wind@foxmail.com>
From: gfree.wind@foxmail.com
Date: Sun, 9 Apr 2017 20:44:41 +0800
> From: Gao Feng <fgao@ikuai8.com>
>
> It should increase TCPABORTONLINGER counter when send RST caused by
> linger2 in keepalive timer.
>
> Signed-off-by: Gao Feng <fgao@ikuai8.com>
> ---
> net/ipv4/tcp_timer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
> index b2ab411..5c01f21 100644
> --- a/net/ipv4/tcp_timer.c
> +++ b/net/ipv4/tcp_timer.c
> @@ -650,6 +650,8 @@ static void tcp_keepalive_timer (unsigned long data)
> tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
> goto out;
> }
> + } else {
> + NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONLINGER);
> }
> tcp_send_active_reset(sk, GFP_ATOMIC);
> goto death;
I think this else clause is completely unnecessary. Just do it right above
the tcp_send_active_reset() call and at the same indentation level.
Alternatively, if you are trying to only bump the counter when tp->linger2 is
>= 0, then you attached the else clause to the wrong if() test.
Thank you.
next prev parent reply other threads:[~2017-04-12 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-09 12:44 [PATCH net 1/1] net: tcp: Increase TCPABORTONLINGER when send RST by linger2 in keepalive timer gfree.wind
2017-04-12 17:20 ` David Miller [this message]
2017-04-12 22:17 ` Gao Feng
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=20170412.132049.1340057228980086886.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=fgao@ikuai8.com \
--cc=gfree.wind@foxmail.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=ncardwell@google.com \
--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).