diff options
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r-- | net/ipv4/tcp_timer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 193ba1fa8a9a..1ec12a4f327e 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -223,7 +223,8 @@ void tcp_delack_timer_handler(struct sock *sk) | |||
223 | 223 | ||
224 | sk_mem_reclaim_partial(sk); | 224 | sk_mem_reclaim_partial(sk); |
225 | 225 | ||
226 | if (sk->sk_state == TCP_CLOSE || !(icsk->icsk_ack.pending & ICSK_ACK_TIMER)) | 226 | if (((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || |
227 | !(icsk->icsk_ack.pending & ICSK_ACK_TIMER)) | ||
227 | goto out; | 228 | goto out; |
228 | 229 | ||
229 | if (time_after(icsk->icsk_ack.timeout, jiffies)) { | 230 | if (time_after(icsk->icsk_ack.timeout, jiffies)) { |
@@ -504,7 +505,8 @@ void tcp_write_timer_handler(struct sock *sk) | |||
504 | struct inet_connection_sock *icsk = inet_csk(sk); | 505 | struct inet_connection_sock *icsk = inet_csk(sk); |
505 | int event; | 506 | int event; |
506 | 507 | ||
507 | if (sk->sk_state == TCP_CLOSE || !icsk->icsk_pending) | 508 | if (((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || |
509 | !icsk->icsk_pending) | ||
508 | goto out; | 510 | goto out; |
509 | 511 | ||
510 | if (time_after(icsk->icsk_timeout, jiffies)) { | 512 | if (time_after(icsk->icsk_timeout, jiffies)) { |
@@ -604,7 +606,8 @@ static void tcp_keepalive_timer (unsigned long data) | |||
604 | goto death; | 606 | goto death; |
605 | } | 607 | } |
606 | 608 | ||
607 | if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE) | 609 | if (!sock_flag(sk, SOCK_KEEPOPEN) || |
610 | ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_SYN_SENT))) | ||
608 | goto out; | 611 | goto out; |
609 | 612 | ||
610 | elapsed = keepalive_time_when(tp); | 613 | elapsed = keepalive_time_when(tp); |