From cb6cd2cec799356e5e2f75a8591894599a6ad49d Mon Sep 17 00:00:00 2001 From: Akhmat Karakotov Date: Mon, 31 Jan 2022 16:31:25 +0300 Subject: tcp: Change SYN ACK retransmit behaviour to account for rehash Disabling rehash behavior did not affect SYN ACK retransmits because hash was forcefully changed bypassing the sk_rethink_hash function. This patch adds a condition which checks for rehash mode before resetting hash. Signed-off-by: Akhmat Karakotov Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller --- net/core/sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'net/core/sock.c') diff --git a/net/core/sock.c b/net/core/sock.c index 5e711b42898f..d6804685f17f 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1452,7 +1452,8 @@ set_sndbuf: ret = -EINVAL; break; } - sk->sk_txrehash = (u8)val; + /* Paired with READ_ONCE() in tcp_rtx_synack() */ + WRITE_ONCE(sk->sk_txrehash, (u8)val); break; default: -- cgit v1.2.3