Skip to content

Commit db7ffee

Browse files
edumazetkuba-moo
authored andcommitted
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: a44d6ea ("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]> Acked-by: Neal Cardwell <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2fbdd56 commit db7ffee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/tcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,6 +2643,8 @@ int tcp_disconnect(struct sock *sk, int flags)
26432643
tp->bytes_acked = 0;
26442644
tp->bytes_received = 0;
26452645
tp->bytes_retrans = 0;
2646+
tp->data_segs_in = 0;
2647+
tp->data_segs_out = 0;
26462648
tp->duplicate_sack[0].start_seq = 0;
26472649
tp->duplicate_sack[0].end_seq = 0;
26482650
tp->dsack_dups = 0;

0 commit comments

Comments
 (0)