]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tcp: Don't pass cookie to __cookie_v[46]_check().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 29 Nov 2023 02:29:20 +0000 (18:29 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Nov 2023 04:16:19 +0000 (20:16 -0800)
commit7577bc8249c3fc86096ef1b1c9a8f4b6232231e7
treeb9fa0eb5cf41c8cc8a616352c1493294e96c79fb
parent50468cddd6bc27e75e7377e376674d40fd1b1d73
tcp: Don't pass cookie to __cookie_v[46]_check().

tcp_hdr(skb) and SYN Cookie are passed to __cookie_v[46]_check(), but
none of the callers passes cookie other than ntohl(th->ack_seq) - 1.

Let's fetch it in __cookie_v[46]_check() instead of passing the cookie
over and over.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20231129022924.96156-5-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netfilter_ipv6.h
include/net/tcp.h
net/core/filter.c
net/ipv4/syncookies.c
net/ipv6/syncookies.c
net/netfilter/nf_synproxy_core.c