qualia_core_db/net/peer/connectivity/
mtu.rs1pub const fn qframe_budget_ipv6(outer_path_mtu: u16) -> u16 {
7 if outer_path_mtu < 128 {
8 return 0;
9 }
10 let inner = outer_path_mtu.saturating_sub(40 + 8 + 32);
11 let aligned = (inner / 16) * 16;
12 aligned.saturating_sub(48)
13}
14
15pub const QFRAME_ON_1280: u16 = qframe_budget_ipv6(1280);
16
17#[cfg(test)]
18mod tests {
19 use super::*;
20
21 #[test]
22 fn conservative_1280_is_1152() {
23 assert_eq!(QFRAME_ON_1280, 1152);
24 assert_eq!(qframe_budget_ipv6(1280), 1152);
25 }
26}