From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net-next] net: loopback: clear skb->tstamp before netif_rx() Date: Fri, 19 Oct 2018 19:11:26 -0700 Message-ID: <20181020021126.61472-1-edumazet@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev , Eric Dumazet , Eric Dumazet , Willem de Bruijn , Soheil Hassas Yeganeh To: "David S . Miller" Return-path: Received: from mail-pf1-f194.google.com ([209.85.210.194]:38098 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbeJTKUN (ORCPT ); Sat, 20 Oct 2018 06:20:13 -0400 Received: by mail-pf1-f194.google.com with SMTP id f29-v6so17261389pff.5 for ; Fri, 19 Oct 2018 19:11:30 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: At least UDP / TCP stacks can now cook skbs with a tstamp using MONOTONIC base (or arbitrary values with SCM_TXTIME) Since loopback driver does not call (directly or indirectly) skb_scrub_packet(), we need to clear skb->tstamp so that net_timestamp_check() can eventually resample the time, using ktime_get_real(). Fixes: 80b14dee2bea ("net: Add a new socket option for a future transmit time.") Fixes: fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Cc: Soheil Hassas Yeganeh --- drivers/net/loopback.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index a7207fa7e451311aed13cdeb100e0ea7922931bf..2df7f60fe05220c19896a251b6b15239f4b95112 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -69,6 +69,10 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb, int len; skb_tx_timestamp(skb); + + /* do not fool net_timestamp_check() with various clock bases */ + skb->tstamp = 0; + skb_orphan(skb); /* Before queueing this packet to netif_rx(), -- 2.19.1.568.g152ad8e336-goog