summaryrefslogtreecommitdiffstats
path: root/net/ipv4/syncookies.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2023-11-28 18:29:17 -0800
committerJakub Kicinski <kuba@kernel.org>2023-11-29 20:15:32 -0800
commit34efc9cfe7c6d11ccc438ca03b59a1bf43cc60ec (patch)
tree09553c2025baf2181ef9efc25fd28cce21747508 /net/ipv4/syncookies.c
parentf422544118cbdfc3bba7b7c5189e18147acb9047 (diff)
downloadlinux-stable-34efc9cfe7c6d11ccc438ca03b59a1bf43cc60ec.tar.gz
linux-stable-34efc9cfe7c6d11ccc438ca03b59a1bf43cc60ec.tar.bz2
linux-stable-34efc9cfe7c6d11ccc438ca03b59a1bf43cc60ec.zip
tcp: Clean up reverse xmas tree in cookie_v[46]_check().
We will grow and cut the xmas tree in cookie_v[46]_check(). This patch cleans it up to make later patches tidy. 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-2-kuniyu@amazon.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/syncookies.c')
-rw-r--r--net/ipv4/syncookies.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index d37282c06e3d..a0118ea76734 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -331,18 +331,18 @@ EXPORT_SYMBOL_GPL(cookie_tcp_reqsk_alloc);
struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
{
struct ip_options *opt = &TCP_SKB_CB(skb)->header.h4.opt;
+ const struct tcphdr *th = tcp_hdr(skb);
+ __u32 cookie = ntohl(th->ack_seq) - 1;
struct tcp_options_received tcp_opt;
+ struct tcp_sock *tp = tcp_sk(sk);
struct inet_request_sock *ireq;
struct tcp_request_sock *treq;
- struct tcp_sock *tp = tcp_sk(sk);
- const struct tcphdr *th = tcp_hdr(skb);
- __u32 cookie = ntohl(th->ack_seq) - 1;
- struct sock *ret = sk;
struct request_sock *req;
+ struct sock *ret = sk;
int full_space, mss;
+ struct flowi4 fl4;
struct rtable *rt;
__u8 rcv_wscale;
- struct flowi4 fl4;
u32 tsoff = 0;
int l3index;