diff options
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r-- | net/ipv4/tcp_timer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 3ea1cf804748..b1e65b3b4361 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -249,7 +249,8 @@ void tcp_delack_timer_handler(struct sock *sk) | |||
249 | 249 | ||
250 | sk_mem_reclaim_partial(sk); | 250 | sk_mem_reclaim_partial(sk); |
251 | 251 | ||
252 | if (sk->sk_state == TCP_CLOSE || !(icsk->icsk_ack.pending & ICSK_ACK_TIMER)) | 252 | if (((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || |
253 | !(icsk->icsk_ack.pending & ICSK_ACK_TIMER)) | ||
253 | goto out; | 254 | goto out; |
254 | 255 | ||
255 | if (time_after(icsk->icsk_ack.timeout, jiffies)) { | 256 | if (time_after(icsk->icsk_ack.timeout, jiffies)) { |
@@ -552,7 +553,8 @@ void tcp_write_timer_handler(struct sock *sk) | |||
552 | struct inet_connection_sock *icsk = inet_csk(sk); | 553 | struct inet_connection_sock *icsk = inet_csk(sk); |
553 | int event; | 554 | int event; |
554 | 555 | ||
555 | if (sk->sk_state == TCP_CLOSE || !icsk->icsk_pending) | 556 | if (((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || |
557 | !icsk->icsk_pending) | ||
556 | goto out; | 558 | goto out; |
557 | 559 | ||
558 | if (time_after(icsk->icsk_timeout, jiffies)) { | 560 | if (time_after(icsk->icsk_timeout, jiffies)) { |