Commit a9497b16 authored by David S. Miller's avatar David S. Miller

[TCP]: When fetching srtt from metrics, do not forget to set rtt_seq.

Otherwise RTT will end up being wrong for a long
time, because tcp_rtt_estimator() requires that
every time srtt is set, rtt_seq is set too.
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 274cac6d
......@@ -852,8 +852,10 @@ static void tcp_init_metrics(struct sock *sk)
* to low value, and then abruptly stops to do it and starts to delay
* ACKs, wait for troubles.
*/
if (dst_metric(dst, RTAX_RTT) > tp->srtt)
if (dst_metric(dst, RTAX_RTT) > tp->srtt) {
tp->srtt = dst_metric(dst, RTAX_RTT);
tp->rtt_seq = tp->snd_nxt;
}
if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) {
tp->mdev = dst_metric(dst, RTAX_RTTVAR);
tp->mdev_max = tp->rttvar = max(tp->mdev, TCP_RTO_MIN);
......
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