From: Eric Dumazet Date: Fri, 31 Jan 2020 18:44:50 +0000 (-0800) Subject: tcp: clear tp->segs_{in|out} in tcp_disconnect() X-Git-Tag: v5.4.19~292 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6a7ba0e8622caae175be80931325233cf970369;p=platform%2Fkernel%2Flinux-rpi.git tcp: clear tp->segs_{in|out} in tcp_disconnect() [ Upstream commit 784f8344de750a41344f4bbbebb8507a730fc99c ] tp->segs_in and tp->segs_out need to be cleared in tcp_disconnect(). tcp_disconnect() is rarely used, but it is worth fixing it. Fixes: 2efd055c53c0 ("tcp: add tcpi_segs_in and tcpi_segs_out to tcp_info") Signed-off-by: Eric Dumazet Cc: Marcelo Ricardo Leitner Cc: Yuchung Cheng Cc: Neal Cardwell Acked-by: Neal Cardwell Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 79e10d2..deb466f 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2635,6 +2635,8 @@ int tcp_disconnect(struct sock *sk, int flags) sk->sk_rx_dst = NULL; tcp_saved_syn_free(tp); tp->compressed_ack = 0; + tp->segs_in = 0; + tp->segs_out = 0; tp->bytes_sent = 0; tp->bytes_acked = 0; tp->bytes_received = 0;