Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4088706ybe; Mon, 9 Sep 2019 04:07:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5nQooL4QsrNqlRLzp5t0BaR8sGEwwpnA1NC41Ci6ePNWW6H3deQmRLc3cNHIs1oKu2dZx X-Received: by 2002:a50:e005:: with SMTP id e5mr23448844edl.279.1568027228188; Mon, 09 Sep 2019 04:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568027228; cv=none; d=google.com; s=arc-20160816; b=h4gWoYSK2hVyl/GER6tXhgBtCQW5C9xbkNb1a5yt880G+g+4mbLTQfUGcDTiwBH0LW btHHbBYL1VJeQG+KzX1YMeDHEXlad3gA0AWDBFsO5UXbmcEy79VWATN2htZYJlDZ9mYq YwFe3aaJe6VPl/XH0BYBLMPWL/UcOk9AjNH4gACjZv+M3/CmRAFrib9yjLsWsWGv+Pba EBS1tjUK7WUY2Nbqc8bWK6JnBpLmUfih0TmfFwEmeHRINcyz6Th1Le4/zN6Ll9J1Xe1M TspYe3+hHmpxrYxw3CVJFBc3JoH1ntTX7ksHhH2qo7CLjDZHhFif4V/QSh4QD6G6jT9u w17g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A11h1RVPMhd00oEokXKHs52g2b2TDmJ5RO/fW+6NArQ=; b=PRxNlF5f9Qxy396rWAugBCQj4VDoteBxjsiWVBMrzW6ijHSVxhtMmCpwTN0NFXGu9B OST1Z4lXD+UVIKKsQJ56cHvuu0gx6HJezGPCwDiN6qaBRWH6cuqieyxyG8TvWTG23YKJ wqx4TLrWmvhzSC8XXU85dr7fQZc9S0/It9JkFvyygaay8LVw9gR5Dwi50PBFXgNSJb9N 3oBaYkaewCwAgUMzC98CUOXhbG/iecJoK8qNJXbr72LfED5Z2mDinIwpq5q8eqo7CeXI gQ/gzPB+lN/qu907A8o0+mhRAza/VQe4Y4EHoxhtJqkD5gtsRY6zmhNXfRTm8uPSdM26 2mMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vO5au8Z3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si6944524ejf.69.2019.09.09.04.06.43; Mon, 09 Sep 2019 04:07:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vO5au8Z3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730875AbfIHMsF (ORCPT + 99 others); Sun, 8 Sep 2019 08:48:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:36854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730864AbfIHMsB (ORCPT ); Sun, 8 Sep 2019 08:48:01 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C3B9F21924; Sun, 8 Sep 2019 12:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946881; bh=AseTGtoaOnMVx1Y9ccsbVx9ZHHRjZZEswyRIdKubALI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vO5au8Z3458b1/y52lh8YXfLnt2ZBX70C9Y/Tl5afYI6pZ4DgOpST4+JrtAC99IY7 1ZYL7DA6wCBqGgau/Auz5qxqQWcSA/t8nsIgX0oud5jnAq2tip2gDT/HFoLLWWVGxX 5TqTax0LfNHj52dhx52fVlb8vbf1VHhwue5hd78A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Willem de Bruijn , Eric Dumazet , "David S. Miller" Subject: [PATCH 4.19 06/57] tcp: inherit timestamp on mtu probe Date: Sun, 8 Sep 2019 13:41:30 +0100 Message-Id: <20190908121127.673678005@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Willem de Bruijn [ Upstream commit 888a5c53c0d8be6e98bc85b677f179f77a647873 ] TCP associates tx timestamp requests with a byte in the bytestream. If merging skbs in tcp_mtu_probe, migrate the tstamp request. Similar to MSG_EOR, do not allow moving a timestamp from any segment in the probe but the last. This to avoid merging multiple timestamps. Tested with the packetdrill script at https://github.com/wdebruij/packetdrill/commits/mtu_probe-1 Link: http://patchwork.ozlabs.org/patch/1143278/#2232897 Fixes: 4ed2d765dfac ("net-timestamp: TCP timestamping") Signed-off-by: Willem de Bruijn Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2046,7 +2046,7 @@ static bool tcp_can_coalesce_send_queue_ if (len <= skb->len) break; - if (unlikely(TCP_SKB_CB(skb)->eor)) + if (unlikely(TCP_SKB_CB(skb)->eor) || tcp_has_tx_tstamp(skb)) return false; len -= skb->len; @@ -2162,6 +2162,7 @@ static int tcp_mtu_probe(struct sock *sk * we need to propagate it to the new skb. */ TCP_SKB_CB(nskb)->eor = TCP_SKB_CB(skb)->eor; + tcp_skb_collapse_tstamp(nskb, skb); tcp_unlink_write_queue(skb, sk); sk_wmem_free_skb(sk, skb); } else {