Commit 49a496c9 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: use correct req pointer in tcp_move_syn() calls

I mistakenly took wrong request sock pointer when calling tcp_move_syn()

@req_unhash is either a copy of @req, or a NULL value for
FastOpen connexions (as we do not expect to unhash the temporary
request sock from ehash table)

Fixes: 805c4bc0 ("tcp: fix req->saved_syn race")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Ying Cai <ycai@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30f7ea1c
...@@ -1327,7 +1327,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb, ...@@ -1327,7 +1327,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
goto put_and_exit; goto put_and_exit;
*own_req = inet_ehash_nolisten(newsk, req_to_sk(req_unhash)); *own_req = inet_ehash_nolisten(newsk, req_to_sk(req_unhash));
if (*own_req) if (*own_req)
tcp_move_syn(newtp, req_unhash); tcp_move_syn(newtp, req);
return newsk; return newsk;
......
...@@ -1141,7 +1141,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * ...@@ -1141,7 +1141,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
} }
*own_req = inet_ehash_nolisten(newsk, req_to_sk(req_unhash)); *own_req = inet_ehash_nolisten(newsk, req_to_sk(req_unhash));
if (*own_req) { if (*own_req) {
tcp_move_syn(newtp, req_unhash); tcp_move_syn(newtp, req);
/* Clone pktoptions received with SYN, if we own the req */ /* Clone pktoptions received with SYN, if we own the req */
if (ireq->pktopts) { if (ireq->pktopts) {
......
Markdown is supported
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