]> Gentwo Git Trees - linux/.git/commit
tcp: fix __tcp_close() to only send RST when required
authorEric Dumazet <edumazet@google.com>
Wed, 3 Sep 2025 08:47:18 +0000 (08:47 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 5 Sep 2025 02:13:41 +0000 (19:13 -0700)
commit5f9238530970f2993b23dd67fdaffc552a2d2e98
tree8057ade9b35db8fdf5b9989f2eb43a73a2314f98
parent69777753a8919b0b8313c856e707e1d1fe5ced85
tcp: fix __tcp_close() to only send RST when required

If the receive queue contains payload that was already
received, __tcp_close() can send an unexpected RST.

Refine the code to take tp->copied_seq into account,
as we already do in tcp recvmsg().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://patch.msgid.link/20250903084720.1168904-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp.c