diff options
| author | Akhmat Karakotov <[email protected]> | 2022-01-31 13:31:25 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-01-31 15:05:25 +0000 |
| commit | cb6cd2cec799356e5e2f75a8591894599a6ad49d (patch) | |
| tree | 7211b0a22e1a7011c1210fbfad9a0695f5a9bd93 /net/ipv4/tcp_output.c | |
| parent | bpf: Add SO_TXREHASH setsockopt (diff) | |
| download | kernel-cb6cd2cec799356e5e2f75a8591894599a6ad49d.tar.gz kernel-cb6cd2cec799356e5e2f75a8591894599a6ad49d.zip | |
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 <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 11c06b9db801..e76bf1e9251e 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -4092,7 +4092,9 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req) struct flowi fl; int res; - tcp_rsk(req)->txhash = net_tx_rndhash(); + /* Paired with WRITE_ONCE() in sock_setsockopt() */ + if (READ_ONCE(sk->sk_txrehash) == SOCK_TXREHASH_ENABLED) + tcp_rsk(req)->txhash = net_tx_rndhash(); res = af_ops->send_synack(sk, NULL, &fl, req, NULL, TCP_SYNACK_NORMAL, NULL); if (!res) { |
