aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 0732b787904e..8c65dc147d8b 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -107,6 +107,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk)
107 if (net->ipv4.sysctl_tcp_mtu_probing) { 107 if (net->ipv4.sysctl_tcp_mtu_probing) {
108 if (!icsk->icsk_mtup.enabled) { 108 if (!icsk->icsk_mtup.enabled) {
109 icsk->icsk_mtup.enabled = 1; 109 icsk->icsk_mtup.enabled = 1;
110 icsk->icsk_mtup.probe_timestamp = tcp_time_stamp;
110 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); 111 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
111 } else { 112 } else {
112 struct net *net = sock_net(sk); 113 struct net *net = sock_net(sk);
@@ -166,7 +167,7 @@ static int tcp_write_timeout(struct sock *sk)
166 if (icsk->icsk_retransmits) { 167 if (icsk->icsk_retransmits) {
167 dst_negative_advice(sk); 168 dst_negative_advice(sk);
168 if (tp->syn_fastopen || tp->syn_data) 169 if (tp->syn_fastopen || tp->syn_data)
169 tcp_fastopen_cache_set(sk, 0, NULL, true); 170 tcp_fastopen_cache_set(sk, 0, NULL, true, 0);
170 if (tp->syn_data) 171 if (tp->syn_data)
171 NET_INC_STATS_BH(sock_net(sk), 172 NET_INC_STATS_BH(sock_net(sk),
172 LINUX_MIB_TCPFASTOPENACTIVEFAIL); 173 LINUX_MIB_TCPFASTOPENACTIVEFAIL);
@@ -326,7 +327,7 @@ static void tcp_fastopen_synack_timer(struct sock *sk)
326 struct request_sock *req; 327 struct request_sock *req;
327 328
328 req = tcp_sk(sk)->fastopen_rsk; 329 req = tcp_sk(sk)->fastopen_rsk;
329 req->rsk_ops->syn_ack_timeout(sk, req); 330 req->rsk_ops->syn_ack_timeout(req);
330 331
331 if (req->num_timeout >= max_retries) { 332 if (req->num_timeout >= max_retries) {
332 tcp_write_err(sk); 333 tcp_write_err(sk);
@@ -538,19 +539,11 @@ static void tcp_write_timer(unsigned long data)
538 sock_put(sk); 539 sock_put(sk);
539} 540}
540 541
541/* 542void tcp_syn_ack_timeout(const struct request_sock *req)
542 * Timer for listening sockets
543 */
544
545static void tcp_synack_timer(struct sock *sk)
546{ 543{
547 inet_csk_reqsk_queue_prune(sk, TCP_SYNQ_INTERVAL, 544 struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
548 TCP_TIMEOUT_INIT, TCP_RTO_MAX);
549}
550 545
551void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req) 546 NET_INC_STATS_BH(net, LINUX_MIB_TCPTIMEOUTS);
552{
553 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPTIMEOUTS);
554} 547}
555EXPORT_SYMBOL(tcp_syn_ack_timeout); 548EXPORT_SYMBOL(tcp_syn_ack_timeout);
556 549
@@ -582,7 +575,7 @@ static void tcp_keepalive_timer (unsigned long data)
582 } 575 }
583 576
584 if (sk->sk_state == TCP_LISTEN) { 577 if (sk->sk_state == TCP_LISTEN) {
585 tcp_synack_timer(sk); 578 pr_err("Hmm... keepalive on a LISTEN ???\n");
586 goto out; 579 goto out;
587 } 580 }
588 581