The driver for the network interface "lo" (loopback device) for Linux does something that I do not understanding with its "outgoing" packets. See the related function:
static netdev_tx_t loopback_xmit(struct sk_buff *skb, struct net_device *dev)
{
int len;
skb_tx_timestamp(skb);
/* do not fool net_timestamp_check() with various clock bases */
skb_clear_tstamp(skb);
skb_orphan(skb);
/* Before queueing this packet to __netif_rx(),
* make sure dst is refcounted.
*/
skb_dst_force(skb);
skb->protocol = eth_type_trans(skb, dev);
len = skb->len;
if (likely(__netif_rx(skb) == NET_RX_SUCCESS))
dev_lstats_add(dev, len);
return NETDEV_TX_OK;
}
I'm confused by these two lines specifically :
skb_tx_timestamp(skb);
skb_clear_tstamp(skb);
What would be the benefit of time stamping the packet just to immediately un-timestamping it?