• Martin KaFai Lau's avatar
    net: ip: Handle delivery_time in ip defrag · 8672406e
    Martin KaFai Lau authored
    A latter patch will postpone the delivery_time clearing until the stack
    knows the skb is being delivered locally.  That will allow other kernel
    forwarding path (e.g. ip[6]_forward) to keep the delivery_time also.
    
    An earlier attempt was to do skb_clear_delivery_time() in
    ip_local_deliver() and ip6_input().  The discussion [0] requested
    to move it one step later into ip_local_deliver_finish()
    and ip6_input_finish() so that the delivery_time can be kept
    for the ip_vs forwarding path also.
    
    To do that, this patch also needs to take care of the (rcv) timestamp
    usecase in ip_is_fragment().  It needs to expect delivery_time in
    the skb->tstamp, so it needs to save the mono_delivery_time bit in
    inet_frag_queue such that the delivery_time (if any) can be restored
    in the final defragmented skb.
    
    [Note that it will only happen when the locally generated skb is looping
     from egress to ingress over a virtual interface (e.g. veth, loopback...),
     skb->tstamp may have the delivery time before it is known that it will
     be delivered locally and received by another sk.]
    
    [0]: https://lore.kernel.org/netdev/ca728d81-80e8-3767-d5e-d44f6ad96e43@ssi.bg/Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8672406e
inet_frag.h 5.01 KB