diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a9329b072b94b..4ccfec4bb6248 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -237,8 +237,9 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb) * when we update icsk_ack.rcv_mss. */ if (unlikely(len != icsk->icsk_ack.rcv_mss)) { - u64 val = __tcp_space_from_win(skb->truesize, skb->len); + u64 val = (u64)skb->len << TCP_RMEM_TO_WIN_SCALE; + do_div(val, skb->truesize); tcp_sk(sk)->scaling_ratio = val ? val : 1; } icsk->icsk_ack.rcv_mss = min_t(unsigned int, len,