diff options
author | Yuchung Cheng <ycheng@google.com> | 2017-12-07 14:33:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-08 14:14:11 -0500 |
commit | 428aec5e69fa17d223e1495f395833c50770f7ae (patch) | |
tree | c100aa3b176a3951c39a7a096e9e0b2ac5d25333 | |
parent | cd1fc85b4399d47e3d6626301741ba8c38cd475a (diff) |
tcp: fix off-by-one bug in RACK
RACK should mark a packet lost when remaining wait time is zero.
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Priyaranjan Jha <priyarjha@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp_recovery.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c index 3143664902e9..0c182303e62e 100644 --- a/net/ipv4/tcp_recovery.c +++ b/net/ipv4/tcp_recovery.c | |||
@@ -80,12 +80,12 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout) | |||
80 | */ | 80 | */ |
81 | remaining = tp->rack.rtt_us + reo_wnd - | 81 | remaining = tp->rack.rtt_us + reo_wnd - |
82 | tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp); | 82 | tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp); |
83 | if (remaining < 0) { | 83 | if (remaining <= 0) { |
84 | tcp_rack_mark_skb_lost(sk, skb); | 84 | tcp_rack_mark_skb_lost(sk, skb); |
85 | list_del_init(&skb->tcp_tsorted_anchor); | 85 | list_del_init(&skb->tcp_tsorted_anchor); |
86 | } else { | 86 | } else { |
87 | /* Record maximum wait time (+1 to avoid 0) */ | 87 | /* Record maximum wait time */ |
88 | *reo_timeout = max_t(u32, *reo_timeout, 1 + remaining); | 88 | *reo_timeout = max_t(u32, *reo_timeout, remaining); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | } | 91 | } |