tcp: clear tp->segs_{in|out} in tcp_disconnect()
Subsystems (3)
PATCH 1/1 tcp: clear tp->segs_{in|out} in tcp_disconnect()
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 <[email protected]>
Cc Marcelo Ricardo Leitner <[email protected]>
Cc Yuchung Cheng <[email protected]>
Cc Neal Cardwell <[email protected]>
--- net/ipv4/tcp.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv4/tcp.c +2 -0
@@ -2639,6 +2639,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 ;
Signature · 1 line
2.25.0.341.g760bfbb309-goog
Quoted 19 lines · Eric Dumazet
tp->segs_inandtp->segs_outneed to be cleared intcp_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 <[email protected]>Cc Marcelo Ricardo Leitner <[email protected]>Cc Yuchung Cheng <[email protected]>Cc Neal Cardwell <[email protected]>--- net/ipv4/tcp.c | 2 ++ 1 file changed, 2 insertions(+)net/ipv4/tcp.c +0
-0
net/ipv4/tcp.c int tcp_disconnect(struct sock *sk, int flags)
Quoted 9 lines
net/ipv4/tcp.c +2
-1@@ -2639,6 +2639,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 ; --
Thanks, Eric!
Acked-by Neal Cardwell <[email protected]>
neal
Jakub Kicinski
maintainerQuoted 9 lines · Eric Dumazet
tp->segs_inandtp->segs_outneed to be cleared intcp_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 <[email protected]>Cc Marcelo Ricardo Leitner <[email protected]>Cc Yuchung Cheng <[email protected]>Cc Neal Cardwell <[email protected]>
Applied all 4 disconnect fixes, and queued them for stable.
Thank you!