mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
ntp: make NTP-over-PTP domain configurable
Add ptpdomain directive to set the domain number of transmitted and accepted NTP-over-PTP messages. It might need to be changed in networks using a PTP profile with the same domain number. The default domain number of 123 follows the current NTP-over-PTP specification.
This commit is contained in:
4
ntp_io.c
4
ntp_io.c
@@ -517,7 +517,7 @@ NIO_UnwrapMessage(SCK_Message *message, int sock_fd, double *net_correction)
|
||||
(msg->header.version != PTP_VERSION_2 &&
|
||||
(msg->header.version != PTP_VERSION_2_1 || msg->header.min_sdoid != 0)) ||
|
||||
ntohs(msg->header.length) != message->length ||
|
||||
msg->header.domain != PTP_DOMAIN_NTP ||
|
||||
msg->header.domain != CNF_GetPtpDomain() ||
|
||||
ntohs(msg->header.flags) != PTP_FLAG_UNICAST ||
|
||||
ntohs(msg->tlv_header.type) != PTP_TLV_NTP ||
|
||||
ntohs(msg->tlv_header.length) != message->length - PTP_NTP_PREFIX_LENGTH) {
|
||||
@@ -565,7 +565,7 @@ wrap_message(SCK_Message *message, int sock_fd)
|
||||
ptp_message->header.type = PTP_TYPE_DELAY_REQ;
|
||||
ptp_message->header.version = PTP_VERSION_2;
|
||||
ptp_message->header.length = htons(PTP_NTP_PREFIX_LENGTH + message->length);
|
||||
ptp_message->header.domain = PTP_DOMAIN_NTP;
|
||||
ptp_message->header.domain = CNF_GetPtpDomain();
|
||||
ptp_message->header.flags = htons(PTP_FLAG_UNICAST);
|
||||
ptp_message->header.sequence_id = htons(sequence_id++);
|
||||
ptp_message->tlv_header.type = htons(PTP_TLV_NTP);
|
||||
|
||||
Reference in New Issue
Block a user