diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 06228e2d010e..96bdb8eae9bb 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -165,13 +165,16 @@ static void tcp_event_data_sent(struct tcp_sock *tp, | |||
165 | if (tcp_packets_in_flight(tp) == 0) | 165 | if (tcp_packets_in_flight(tp) == 0) |
166 | tcp_ca_event(sk, CA_EVENT_TX_START); | 166 | tcp_ca_event(sk, CA_EVENT_TX_START); |
167 | 167 | ||
168 | tp->lsndtime = now; | 168 | /* If this is the first data packet sent in response to the |
169 | 169 | * previous received data, | |
170 | /* If it is a reply for ato after last received | 170 | * and it is a reply for ato after last received packet, |
171 | * packet, enter pingpong mode. | 171 | * increase pingpong count. |
172 | */ | 172 | */ |
173 | if ((u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato) | 173 | if (before(tp->lsndtime, icsk->icsk_ack.lrcvtime) && |
174 | inet_csk_enter_pingpong_mode(sk); | 174 | (u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato) |
175 | inet_csk_inc_pingpong_cnt(sk); | ||
176 | |||
177 | tp->lsndtime = now; | ||
175 | } | 178 | } |
176 | 179 | ||
177 | /* Account for an ACK we sent. */ | 180 | /* Account for an ACK we sent. */ |