aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2020-01-31 10:32:41 -0800
committerJakub Kicinski <kuba@kernel.org>2020-01-31 22:12:22 -0800
commitdb7ffee6f3eb3683cdcaeddecc0a630a14546fe3 (patch)
treef1b8aabc193d04584774dabc53b9b33ca3c9a9a8 /net/ipv4/tcp.c
parenttcp: clear tp->delivered in tcp_disconnect() (diff)
downloadlinux-dev-db7ffee6f3eb3683cdcaeddecc0a630a14546fe3.tar.xz
linux-dev-db7ffee6f3eb3683cdcaeddecc0a630a14546fe3.zip
tcp: clear tp->data_segs{in|out} in tcp_disconnect()
tp->data_segs_in and tp->data_segs_out need to be cleared in tcp_disconnect(). tcp_disconnect() is rarely used, but it is worth fixing it. Fixes: a44d6eacdaf5 ("tcp: Add RFC4898 tcpEStatsPerfDataSegsOut/In") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Martin KaFai Lau <kafai@fb.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Neal Cardwell <ncardwell@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index a8ffdfb61f42..3b601823f69a 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2643,6 +2643,8 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->bytes_acked = 0;
tp->bytes_received = 0;
tp->bytes_retrans = 0;
+ tp->data_segs_in = 0;
+ tp->data_segs_out = 0;
tp->duplicate_sack[0].start_seq = 0;
tp->duplicate_sack[0].end_seq = 0;
tp->dsack_dups = 0;