fix(proto): floor negative echo lengths

This commit is contained in:
Nils Andreas Svee committed 2026-08-12 17:16:03 +07:00
1 parent 2e2db4d3e0
commit 68ed5c6e2e
12 files changed
+107 -95

No files matched your search

@@ -1,8 +1,8 @@
use super::*;
pub(crate) use irtt_proto::echo_packet_len;
use irtt_proto::{
echo_packet_len as checked_echo_packet_len, encode_echo_reply, encode_open_reply,
flags::FLAG_OPEN, flags::FLAG_REPLY, layout::PacketLayout, Clock, EchoReply, OpenReply,
ReceivedStats, StampAt,
encode_echo_reply, encode_open_reply, flags::FLAG_OPEN, flags::FLAG_REPLY,
layout::PacketLayout, Clock, EchoReply, OpenReply, ReceivedStats, StampAt,
};
use std::{
net::UdpSocket,
@@ -72,11 +72,6 @@ pub(super) fn open_reply(
.unwrap()
}
pub(crate) fn echo_packet_len(hmac: bool, params: &Params) -> usize {
checked_echo_packet_len(hmac, params)
.expect("test params must have a non-negative packet length")
}
pub(super) fn echo_reply_packet(
token: u64,
seq: u32,