diff options
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r-- | net/ipv4/tcp_timer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 05be564414e9..dd5a6317a801 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -386,15 +386,13 @@ abort: tcp_write_err(sk); | |||
386 | * Timer for Fast Open socket to retransmit SYNACK. Note that the | 386 | * Timer for Fast Open socket to retransmit SYNACK. Note that the |
387 | * sk here is the child socket, not the parent (listener) socket. | 387 | * sk here is the child socket, not the parent (listener) socket. |
388 | */ | 388 | */ |
389 | static void tcp_fastopen_synack_timer(struct sock *sk) | 389 | static void tcp_fastopen_synack_timer(struct sock *sk, struct request_sock *req) |
390 | { | 390 | { |
391 | struct inet_connection_sock *icsk = inet_csk(sk); | 391 | struct inet_connection_sock *icsk = inet_csk(sk); |
392 | int max_retries = icsk->icsk_syn_retries ? : | 392 | int max_retries = icsk->icsk_syn_retries ? : |
393 | sock_net(sk)->ipv4.sysctl_tcp_synack_retries + 1; /* add one more retry for fastopen */ | 393 | sock_net(sk)->ipv4.sysctl_tcp_synack_retries + 1; /* add one more retry for fastopen */ |
394 | struct tcp_sock *tp = tcp_sk(sk); | 394 | struct tcp_sock *tp = tcp_sk(sk); |
395 | struct request_sock *req; | ||
396 | 395 | ||
397 | req = tcp_sk(sk)->fastopen_rsk; | ||
398 | req->rsk_ops->syn_ack_timeout(req); | 396 | req->rsk_ops->syn_ack_timeout(req); |
399 | 397 | ||
400 | if (req->num_timeout >= max_retries) { | 398 | if (req->num_timeout >= max_retries) { |
@@ -435,11 +433,14 @@ void tcp_retransmit_timer(struct sock *sk) | |||
435 | struct tcp_sock *tp = tcp_sk(sk); | 433 | struct tcp_sock *tp = tcp_sk(sk); |
436 | struct net *net = sock_net(sk); | 434 | struct net *net = sock_net(sk); |
437 | struct inet_connection_sock *icsk = inet_csk(sk); | 435 | struct inet_connection_sock *icsk = inet_csk(sk); |
436 | struct request_sock *req; | ||
438 | 437 | ||
439 | if (tp->fastopen_rsk) { | 438 | req = rcu_dereference_protected(tp->fastopen_rsk, |
439 | lockdep_sock_is_held(sk)); | ||
440 | if (req) { | ||
440 | WARN_ON_ONCE(sk->sk_state != TCP_SYN_RECV && | 441 | WARN_ON_ONCE(sk->sk_state != TCP_SYN_RECV && |
441 | sk->sk_state != TCP_FIN_WAIT1); | 442 | sk->sk_state != TCP_FIN_WAIT1); |
442 | tcp_fastopen_synack_timer(sk); | 443 | tcp_fastopen_synack_timer(sk, req); |
443 | /* Before we receive ACK to our SYN-ACK don't retransmit | 444 | /* Before we receive ACK to our SYN-ACK don't retransmit |
444 | * anything else (e.g., data or FIN segments). | 445 | * anything else (e.g., data or FIN segments). |
445 | */ | 446 | */ |