mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
ntp: add extension field to provide network correction
To be able to verify PTP corrections, the client will need to know both the correction of the request received by the server and the correction of the response. Add a new experimental NTP extension field that the clients will use to request the correction and servers return the value.
This commit is contained in:
@@ -375,6 +375,7 @@ do_size_checks(void)
|
||||
assert(offsetof(NTP_Packet, transmit_ts) == 40);
|
||||
|
||||
assert(sizeof (NTP_EFExpMonoRoot) == 24);
|
||||
assert(sizeof (NTP_EFExpNetCorrection) == 24);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
@@ -1595,6 +1596,11 @@ parse_packet(NTP_Packet *packet, int length, NTP_PacketInfo *info)
|
||||
NTP_EF_EXP_MONO_ROOT_MAGIC))
|
||||
info->ext_field_flags |= NTP_EF_FLAG_EXP_MONO_ROOT;
|
||||
break;
|
||||
case NTP_EF_EXP_NET_CORRECTION:
|
||||
if (is_exp_ef(ef_body, ef_body_length, sizeof (NTP_EFExpNetCorrection),
|
||||
NTP_EF_EXP_NET_CORRECTION_MAGIC))
|
||||
info->ext_field_flags |= NTP_EF_FLAG_EXP_NET_CORRECTION;
|
||||
break;
|
||||
default:
|
||||
DEBUG_LOG("Unknown extension field type=%x", (unsigned int)ef_type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user