From ccff8b8caa02b459d750bad4da9ce59a7fbe9f4c Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 19 Oct 2018 19:11:26 -0700 Subject: [PATCH] net: loopback: clear skb->tstamp before netif_rx() 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: 0ac40e4e9536 ("net: Add a new socket option for a future transmit time.") Fixes: fff99772a27e ("tcp/fq: move back to CLOCK_MONOTONIC") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Cc: Soheil Hassas Yeganeh Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller --- drivers/net/loopback.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index a7207fa7e4513..2df7f60fe0522 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.39.5