]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - net/ipv4/tcp.c
tcp: Reset bytes_acked and bytes_received when disconnecting
authorChristoph Paasch <cpaasch@apple.com>
Sat, 6 Jul 2019 23:13:07 +0000 (16:13 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit7cd252c8f44214d5decd190a612a36f367183094
tree0b4a0cdf14143e32678452de253df3bc622e0280
parentdc3aab78df11b6be679096d9c8f2b3cd5d985f9f
tcp: Reset bytes_acked and bytes_received when disconnecting

BugLink: https://bugs.launchpad.net/bugs/1839036
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/ipv4/tcp.c