We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 223fe7a commit cb44ee1Copy full SHA for cb44ee1
ntp-proto/src/source.rs
@@ -567,10 +567,9 @@ impl<Controller: SourceController<MeasurementDelay = NtpDuration>> NtpSource<Con
567
// when requesting new cookies. We keep 350
568
// bytes of margin for header, ids, extension
569
// field headers and signature.
570
- let new_cookies = nts
571
- .cookies
572
- .gap()
573
- .min(((self.buffer.len() - 300) / cookie.len()).min(u8::MAX as usize) as u8);
+ let new_cookies = nts.cookies.gap().min(
+ ((self.buffer.len() - 300) / (cookie.len().max(1))).min(u8::MAX as usize) as u8,
+ );
574
// Defence in depth, ensure we can get at least 1 new cookie.
575
if new_cookies == 0 {
576
warn!("NTS Cookie too large, resetting source. This may be a problem with the source");
0 commit comments