[chrony-dev] [Git][chrony/chrony][master] 3 commits: ntp: pass SCK_Message to extract_udp_data()

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


Title: GitLab

Miroslav Lichvar pushed to branch master at chrony / chrony

Commits:

  • f709edb1
    by Miroslav Lichvar at 2025-11-13T16:16:58+01:00
    ntp: pass SCK_Message to extract_udp_data()
    
    Modify the message length directly in extract_udp_data() to make the
    caller's code more clear.
    
  • 45073599
    by Miroslav Lichvar at 2025-11-18T15:50:54+01:00
    socket: add support for Linux timestamping transmit IDs
    
    Add a new field to the SCK_Message structure to enable setting and
    getting of the Linux timestamping transmit IDs enabled by the
    SOF_TIMESTAMPING_OPT_ID socket option. The ID can be set for each packet
    individually by the SCM_TS_OPT_ID control message (supported on Linux
    6.13 and newer).
    
    This will allow procesing of transmit timestamps without extracting data
    from the data-link frames.
    
  • e5abf3ad
    by Miroslav Lichvar at 2025-11-18T15:55:36+01:00
    ntp: add alternative method of retrieving transmitted messages
    
    When chronyd gets a kernel or hardware transmit timestamp after sending
    an NTP message to a server, peer, or client (using interleaved mode), it
    needs the address and content of the message to be able to correctly
    assign the timestamp to the server, peer, or client. The timestamps are
    processed asynchronously. The kernel provides with each timestamp the
    data-link frame that was timestamped, but chronyd can extract the
    necessary data only from plain IPv4 and IPv6 packets in Ethernet frames,
    possibly including VLAN tags. If the NTP packets are transmitted by a
    non-Ethernet device, or they are encapsulated in another layer (e.g. a
    WireGuard tunnel), chronyd is not able to extract the data and use the
    kernel or hardware transmit timestamps, having to fall back to less
    accurate daemon timestamps.
    
    Add an alternative method using transmit IDs assigned to each message
    (supported since Linux 6.13), which are provided by the kernel with the
    timestamp in the error queue, and map them to messages, addresses and
    ports saved in a ring buffer, whose size can be configured by the new
    maxtxbuffers directive.
    
    Fow now, set the default maxtxbuffers to 0 (disabled). If set to a
    non-zero value, allocate the ring buffer to the maximum size on start.
    As a future improvement, it could be allocated only when the extraction
    of the UDP payload fails, or the extracted message is not the expected
    NTP message. The size could grow dynamically when a transmit ID is
    missed.
    

9 changed files:



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/