提交 673f3b0a 编写于 作者: E Eric Dumazet 提交者: Yang Yingliang

tcp: clear tp->total_retrans in tcp_disconnect()

stable inclusion
from linux-4.19.103
commit 4206e664b120c957af7df7a21fd192b9616078ea

--------------------------------

[ Upstream commit c13c48c0 ]

total_retrans needs to be cleared in tcp_disconnect().

tcp_disconnect() is rarely used, but it is worth fixing it.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: NEric Dumazet <edumazet@google.com>
Cc: SeongJae Park <sjpark@amazon.de>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLi Aichun <liaichun@huawei.com>
Reviewed-by: Nguodeqing <geffrey.guo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d417f5c1
...@@ -2592,6 +2592,7 @@ int tcp_disconnect(struct sock *sk, int flags) ...@@ -2592,6 +2592,7 @@ int tcp_disconnect(struct sock *sk, int flags)
tcp_set_ca_state(sk, TCP_CA_Open); tcp_set_ca_state(sk, TCP_CA_Open);
tp->is_sack_reneg = 0; tp->is_sack_reneg = 0;
tcp_clear_retrans(tp); tcp_clear_retrans(tp);
tp->total_retrans = 0;
inet_csk_delack_init(sk); inet_csk_delack_init(sk);
/* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0 /* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0
* issue in __tcp_select_window() * issue in __tcp_select_window()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册