diff options
Diffstat (limited to 'ntp_io.c')
-rw-r--r-- | ntp_io.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -513,9 +513,11 @@ NIO_UnwrapMessage(SCK_Message *message, int sock_fd, double *net_correction) msg = message->data; - if (msg->header.type != PTP_TYPE_DELAY_REQ || msg->header.version != PTP_VERSION || + if ((msg->header.type != PTP_TYPE_DELAY_REQ && msg->header.type != PTP_TYPE_SYNC) || + (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) { @@ -561,9 +563,9 @@ wrap_message(SCK_Message *message, int sock_fd) memset(ptp_message, 0, PTP_NTP_PREFIX_LENGTH); ptp_message->header.type = PTP_TYPE_DELAY_REQ; - ptp_message->header.version = PTP_VERSION; + 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); |