mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 17:45:07 -05:00
ntp: add pre-NTPv5 experimental extension field
Add an experimental extension field for some features that were proposed for NTPv5. Higher-resolution root delay and dispersion (using 28-bit fraction) are added. A monotonic receive timestamp will allow a frequency transfer between the server and client. The client will be able to separate the server's time corrections from frequency corrections by tracking the offset between the real-time and monotonic receive timestamps. The field has a type of 0xF323 from the new experimental range proposed by the NTP working group. Include a magic 32-bit value in the field to avoid interoperability issues if a different implementation choses the same type for its own experimental field. The value will be changed on incompatible changes to avoid issues between two different chrony versions.
This commit is contained in:
@@ -1406,6 +1406,11 @@ parse_packet(NTP_Packet *packet, int length, NTP_PacketInfo *info)
|
||||
case NTP_EF_NTS_AUTH_AND_EEF:
|
||||
info->auth.mode = NTP_AUTH_NTS;
|
||||
break;
|
||||
case NTP_EF_EXP1:
|
||||
if (ef_body_length == sizeof (NTP_ExtFieldExp1) &&
|
||||
ntohl(((NTP_ExtFieldExp1 *)ef_body)->magic) == NTP_EF_EXP1_MAGIC)
|
||||
info->ext_field_flags |= NTP_EF_FLAG_EXP1;
|
||||
break;
|
||||
default:
|
||||
DEBUG_LOG("Unknown extension field type=%x", (unsigned int)ef_type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user