tcp: clear tp->data_segs{in|out} in tcp_disconnect()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
Cc Martin KaFai Lau <[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
@@ -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 ;
Signature · 1 line
2.25.0.341.g760bfbb309-goog
Quoted 20 lines · Eric Dumazet
tp->data_segs_inandtp->data_segs_outneed to be cleared intcp_disconnect().
tcp_disconnect()is rarely used, but it is worth fixing it.Fixes a44d6eacdaf5 ("tcp: Add RFC4898 tcpEStatsPerfDataSegsOut/In")Signed-off-by Eric Dumazet <[email protected]>Cc Martin KaFai Lau <[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@@ -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 ; --
Thanks, Eric!
Acked-by Neal Cardwell <[email protected]>
neal