From af2eb5a4541b2ddadf2538ff4dc3da365ef12814 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 19 Jan 2021 22:20:40 +0100 Subject: [PATCH] Clarify docs of DeviceCapabilities MTU. Fixes #392 --- src/phy/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/phy/mod.rs b/src/phy/mod.rs index e21963b..03bc779 100644 --- a/src/phy/mod.rs +++ b/src/phy/mod.rs @@ -197,7 +197,13 @@ pub struct DeviceCapabilities { /// The network device is unable to send or receive frames larger than the value returned /// by this function. /// - /// For Ethernet, MTU will fall between 576 (for IPv4) or 1280 (for IPv6) and 9216 octets. + /// For Ethernet devices, this is the maximum Ethernet frame size, including the Ethernet header (14 octets), but + /// *not* including the Ethernet FCS (4 octets). Therefore, Ethernet MTU = IP MTU + 14. + /// + /// Note that in Linux and other OSes, "MTU" is the IP MTU, not the Ethernet MTU, even for Ethernet + /// devices. This is a common source of confusion. + /// + /// Most common IP MTU is 1500. Minimum is 576 (for IPv4) or 1280 (for IPv6). Maximum is 9216 octets. pub max_transmission_unit: usize, /// Maximum burst size, in terms of MTU.