Skip to content

Commit 4c16128

Browse files
edumazetdavem330
authored andcommitted
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: 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 <[email protected]> Cc: Willem de Bruijn <[email protected]> Cc: Soheil Hassas Yeganeh <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b5b4185 commit 4c16128

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/loopback.c

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

7171
skb_tx_timestamp(skb);
72+
73+
/* do not fool net_timestamp_check() with various clock bases */
74+
skb->tstamp = 0;
75+
7276
skb_orphan(skb);
7377

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

0 commit comments

Comments
 (0)