From 054d252e1e6cd3b70f9b25cb8f32eeea0b519f81 Mon Sep 17 00:00:00 2001 From: "build-mesh.bot" Date: Thu, 9 Nov 2023 14:56:33 +0100 Subject: [PATCH] clarify the max size of the CMSG buffer --- quinn-udp/src/windows.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quinn-udp/src/windows.rs b/quinn-udp/src/windows.rs index 0fa32344bc..d3e39db9a4 100644 --- a/quinn-udp/src/windows.rs +++ b/quinn-udp/src/windows.rs @@ -14,7 +14,8 @@ use crate::EcnCodepoint; use super::{cmsg, log_sendmsg_error, RecvMeta, Transmit, UdpSockRef, IO_ERROR_LOG_INTERVAL}; -const CMSG_LEN: usize = 128; // FIXME arbitrary value, same as unix ?, is it too small/much ? +// Enough to store max(IP_PKTINFO + IP_ECN, IPV6_PKTINFO + IPV6_ECN) bytes (header + data) and some extra margin +const CMSG_LEN: usize = 128; // FIXME this could use [`std::sync::OnceLock`] once the MSRV is bumped to 1.70 and upper static WSARECVMSG_PTR: OnceCell = OnceCell::new();