summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAntoine Tenart <atenart@kernel.org>2023-05-23 18:14:52 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-27 08:57:00 +0200
commit67f6f186ccae18ecd08857081425af96337d30cb (patch)
tree67abc5f91ed387c298a386e60bf34fa84b5adf0b /include
parentd5c3b02ffd1c4b169bd0e4bbbda53df7c389d9ae (diff)
downloadlinux-stable-67f6f186ccae18ecd08857081425af96337d30cb.tar.gz
linux-stable-67f6f186ccae18ecd08857081425af96337d30cb.tar.bz2
linux-stable-67f6f186ccae18ecd08857081425af96337d30cb.zip
net: ipv4: use consistent txhash in TIME_WAIT and SYN_RECV
[ Upstream commit c0a8966e2bc7d31f77a7246947ebc09c1ff06066 ] 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: Antoine Tenart <atenart@kernel.org> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Stable-dep-of: 5e5265522a9a ("tcp: annotate data-races around tcp_rsk(req)->txhash") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index acec504c469a..83a1a9bc3ceb 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -282,7 +282,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
const struct ip_options *sopt,
__be32 daddr, __be32 saddr,
const struct ip_reply_arg *arg,
- unsigned int len, u64 transmit_time);
+ unsigned int len, u64 transmit_time, u32 txhash);
#define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field)
#define __IP_INC_STATS(net, field) __SNMP_INC_STATS64((net)->mib.ip_statistics, field)