Skip to content
Commit 67f6f186 authored by Antoine Tenart's avatar Antoine Tenart Committed by Greg Kroah-Hartman
Browse files

net: ipv4: use consistent txhash in TIME_WAIT and SYN_RECV

[ Upstream commit c0a8966e

 ]

When using IPv4/TCP, skb->hash comes from sk->sk_txhash except in
TIME_WAIT and SYN_RECV where it's not set in the reply skb from
ip_send_unicast_reply. Those packets will have a mismatched hash with
others from the same flow as their hashes will be 0. IPv6 does not have
the same issue as the hash is set from the socket txhash in those cases.

This commits sets the hash in the reply skb from ip_send_unicast_reply,
which makes the IPv4 code behaving like IPv6.

Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Stable-dep-of: 5e526552

 ("tcp: annotate data-races around tcp_rsk(req)->txhash")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d5c3b02f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment