Skip to content

Commit

Permalink
Update draft version and ignore kiss codes
Browse files Browse the repository at this point in the history
This allows running NTPv5 against ourselves.
  • Loading branch information
tdittr committed Nov 1, 2023
1 parent e97701d commit 0a4bcb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ntp-proto/src/packet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,8 @@ impl<'a> NtpPacket<'a> {
NtpHeader::V3(header) => header.reference_id,
NtpHeader::V4(header) => header.reference_id,
#[cfg(feature = "ntpv5")]
NtpHeader::V5(_header) => todo!("NTPv5 does not have reference IDs"),
// TODO NTPv5 does not have reference IDs so this should always be None for now
NtpHeader::V5(_header) => ReferenceId::NONE,
}
}

Expand All @@ -951,7 +952,8 @@ impl<'a> NtpPacket<'a> {
NtpHeader::V3(header) => header.stratum == 0,
NtpHeader::V4(header) => header.stratum == 0,
#[cfg(feature = "ntpv5")]
NtpHeader::V5(_header) => todo!("NTPv5 does not have kiss codes yet"),
// TODO NTPv5 does not have Kiss codes so we pretend everything is always fine
NtpHeader::V5(_header) => false,
}
}

Expand Down
2 changes: 1 addition & 1 deletion ntp-proto/src/packet/v5/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub use error::V5Error;
use super::RequestIdentifier;

#[allow(dead_code)]
pub(crate) const DRAFT_VERSION: &str = "draft-ietf-ntp-ntpv5-00";
pub(crate) const DRAFT_VERSION: &str = "draft-ietf-ntp-ntpv5-01";
pub(crate) const UPGRADE_TIMESTAMP: NtpTimestamp = NtpTimestamp::from_bits(*b"NTP5NTP5");

#[repr(u8)]
Expand Down

0 comments on commit 0a4bcb5

Please sign in to comment.