diff --git a/src/config/transport.rs b/src/config/transport.rs index 2281ee4..cb7b3a8 100644 --- a/src/config/transport.rs +++ b/src/config/transport.rs @@ -267,8 +267,10 @@ pub struct EthernetConfig { #[serde(default, skip_serializing_if = "Option::is_none")] pub ethertype: Option, - /// MTU override. Defaults to the interface's MTU minus 1 (for frame type prefix). - /// Cannot exceed the interface's actual MTU. + /// MTU override. Defaults to the interface's MTU minus 3 bytes of frame + /// header (`[type:1][length:2 LE][payload]`). The 2-byte length field is + /// required to trim NIC minimum-frame padding before AEAD verification. + /// Cannot exceed the interface's actual MTU minus 3. #[serde(default, skip_serializing_if = "Option::is_none")] pub mtu: Option, diff --git a/src/transport/ethernet/mod.rs b/src/transport/ethernet/mod.rs index 759b774..60b0dbf 100644 --- a/src/transport/ethernet/mod.rs +++ b/src/transport/ethernet/mod.rs @@ -49,7 +49,9 @@ pub struct EthernetTransport { local_mac: Option<[u8; 6]>, /// Interface name (from config). interface: String, - /// Effective MTU (interface MTU - 1 for frame type prefix). + /// Effective payload MTU: interface MTU minus 3 bytes of frame header + /// (`[type:1][length:2 LE][payload]`). The 2-byte length field is required + /// to trim NIC minimum-frame padding before AEAD verification. effective_mtu: u16, /// Discovery buffer for discovered peers. discovery_buffer: Arc,