aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-04-08 18:34:04 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-08 20:19:42 -0400
commitdd929c1b3df94a7236c637fe294f04653d07b0d5 (patch)
treedf21fba4fdc2ae548c09f7b415f5c86c0433e83c
parent82740b9ac2fbd935361c1dc770ec49b692c28e7d (diff)
tcp: do not rearm rsk_timer on FastOpen requests
FastOpen requests are not like other regular request sockets. They do not yet use rsk_timer : tcp_fastopen_queue_check() simply manually removes one expired request from fastopenq->rskq_rst list. Therefore, tcp_check_req() must not call mod_timer_pending(), otherwise we crash because rsk_timer was not initialized. Fixes: fa76ce7328b ("inet: get rid of central tcp/dccp listener timer") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/tcp_minisocks.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index d7003911c894..2088fdcca141 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -628,10 +628,16 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
628 LINUX_MIB_TCPACKSKIPPEDSYNRECV, 628 LINUX_MIB_TCPACKSKIPPEDSYNRECV,
629 &tcp_rsk(req)->last_oow_ack_time) && 629 &tcp_rsk(req)->last_oow_ack_time) &&
630 630
631 !inet_rtx_syn_ack(sk, req)) 631 !inet_rtx_syn_ack(sk, req)) {
632 mod_timer_pending(&req->rsk_timer, jiffies + 632 unsigned long expires = jiffies;
633 min(TCP_TIMEOUT_INIT << req->num_timeout, 633
634 TCP_RTO_MAX)); 634 expires += min(TCP_TIMEOUT_INIT << req->num_timeout,
635 TCP_RTO_MAX);
636 if (!fastopen)
637 mod_timer_pending(&req->rsk_timer, expires);
638 else
639 req->rsk_timer.expires = expires;
640 }
635 return NULL; 641 return NULL;
636 } 642 }
637 643