diff options
author | Christoph Paasch | 2019-07-07 01:13:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2019-07-28 08:29:26 +0200 |
commit | 1b200acde418f4d6d87279d3f6f976ebf188f272 (patch) | |
tree | e1f927bf958b427836e2edeb02fe48f3fc0cb96b /net | |
parent | tcp: fix tcp_set_congestion_control() use from bpf hook (diff) | |
download | kernel-qcow2-linux-1b200acde418f4d6d87279d3f6f976ebf188f272.tar.gz kernel-qcow2-linux-1b200acde418f4d6d87279d3f6f976ebf188f272.tar.xz kernel-qcow2-linux-1b200acde418f4d6d87279d3f6f976ebf188f272.zip |
tcp: Reset bytes_acked and bytes_received when disconnecting
[ Upstream commit e858faf556d4e14c750ba1e8852783c6f9520a0e ]
If an app is playing tricks to reuse a socket via tcp_disconnect(),
bytes_acked/received needs to be reset to 0. Otherwise tcp_info will
report the sum of the current and the old connection..
Cc: Eric Dumazet <edumazet@google.com>
Fixes: 0df48c26d841 ("tcp: add tcpi_bytes_acked to tcp_info")
Fixes: bdd1f9edacb5 ("tcp: add tcpi_bytes_received to tcp_info")
Signed-off-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index cc25c8cbe15a..b7ef367fe6a1 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2594,6 +2594,8 @@ int tcp_disconnect(struct sock *sk, int flags) tcp_saved_syn_free(tp); tp->compressed_ack = 0; tp->bytes_sent = 0; + tp->bytes_acked = 0; + tp->bytes_received = 0; tp->bytes_retrans = 0; tp->dsack_dups = 0; tp->reord_seen = 0; |