aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index ad1482dd215e..7f4a8d5f6eb0 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -197,11 +197,13 @@ static void tcp_enter_quickack_mode(struct sock *sk)
197 * and the session is not interactive. 197 * and the session is not interactive.
198 */ 198 */
199 199
200static inline bool tcp_in_quickack_mode(const struct sock *sk) 200static bool tcp_in_quickack_mode(struct sock *sk)
201{ 201{
202 const struct inet_connection_sock *icsk = inet_csk(sk); 202 const struct inet_connection_sock *icsk = inet_csk(sk);
203 const struct dst_entry *dst = __sk_dst_get(sk);
203 204
204 return icsk->icsk_ack.quick && !icsk->icsk_ack.pingpong; 205 return (dst && dst_metric(dst, RTAX_QUICKACK)) ||
206 (icsk->icsk_ack.quick && !icsk->icsk_ack.pingpong);
205} 207}
206 208
207static void tcp_ecn_queue_cwr(struct tcp_sock *tp) 209static void tcp_ecn_queue_cwr(struct tcp_sock *tp)
@@ -3951,7 +3953,6 @@ void tcp_reset(struct sock *sk)
3951static void tcp_fin(struct sock *sk) 3953static void tcp_fin(struct sock *sk)
3952{ 3954{
3953 struct tcp_sock *tp = tcp_sk(sk); 3955 struct tcp_sock *tp = tcp_sk(sk);
3954 const struct dst_entry *dst;
3955 3956
3956 inet_csk_schedule_ack(sk); 3957 inet_csk_schedule_ack(sk);
3957 3958
@@ -3963,9 +3964,7 @@ static void tcp_fin(struct sock *sk)
3963 case TCP_ESTABLISHED: 3964 case TCP_ESTABLISHED:
3964 /* Move to CLOSE_WAIT */ 3965 /* Move to CLOSE_WAIT */
3965 tcp_set_state(sk, TCP_CLOSE_WAIT); 3966 tcp_set_state(sk, TCP_CLOSE_WAIT);
3966 dst = __sk_dst_get(sk); 3967 inet_csk(sk)->icsk_ack.pingpong = 1;
3967 if (!dst || !dst_metric(dst, RTAX_QUICKACK))
3968 inet_csk(sk)->icsk_ack.pingpong = 1;
3969 break; 3968 break;
3970 3969
3971 case TCP_CLOSE_WAIT: 3970 case TCP_CLOSE_WAIT: