Commit 428aec5e authored by Yuchung Cheng's avatar Yuchung Cheng Committed by David S. Miller

tcp: fix off-by-one bug in RACK

RACK should mark a packet lost when remaining wait time is zero.
Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
Reviewed-by: default avatarNeal Cardwell <ncardwell@google.com>
Reviewed-by: default avatarPriyaranjan Jha <priyarjha@google.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cd1fc85b
...@@ -80,12 +80,12 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout) ...@@ -80,12 +80,12 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout)
*/ */
remaining = tp->rack.rtt_us + reo_wnd - remaining = tp->rack.rtt_us + reo_wnd -
tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp); tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp);
if (remaining < 0) { if (remaining <= 0) {
tcp_rack_mark_skb_lost(sk, skb); tcp_rack_mark_skb_lost(sk, skb);
list_del_init(&skb->tcp_tsorted_anchor); list_del_init(&skb->tcp_tsorted_anchor);
} else { } else {
/* Record maximum wait time (+1 to avoid 0) */ /* Record maximum wait time */
*reo_timeout = max_t(u32, *reo_timeout, 1 + remaining); *reo_timeout = max_t(u32, *reo_timeout, remaining);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment