Skip to content

Commit 3fdf483

Browse files
edumazetgregkh
authored andcommitted
net: loopback: clear skb->tstamp before netif_rx()
[ Upstream commit 4c16128 ] 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: 80b14de ("net: Add a new socket option for a future transmit time.") Fixes: fb420d5 ("tcp/fq: move back to CLOCK_MONOTONIC") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Willem de Bruijn <willemb@google.com> Cc: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cf5819b commit 3fdf483

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎drivers/net/loopback.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
7575
int len;
7676

7777
skb_tx_timestamp(skb);
78+
79+
/* do not fool net_timestamp_check() with various clock bases */
80+
skb->tstamp = 0;
81+
7882
skb_orphan(skb);
7983

8084
/* Before queueing this packet to netif_rx(),

0 commit comments

Comments
 (0)