const fn max_icmp_payload_length(mtu: usize) -> usize {
    // Based on the following logic:
    // https://osscs.corp.google.com/fuchsia/fuchsia/+/main:third_party/golibs/vendor/gvisor.dev/gvisor/pkg/tcpip/network/ipv4/ipv4.go;l=402;drc=42abed01bbe5e1fb34f17f64f63f6e7ba27a74c7
    // The max payload length is rounded down to the nearest number that is
    // divisible by 8 bytes.
    ((mtu
        - packet_formats::ethernet::testutil::ETHERNET_HDR_LEN_NO_TAG
        - packet_formats::ipv4::testutil::IPV4_MIN_HDR_LEN)
        & !7)
        - ping::ICMP_HEADER_LEN
}
/// Returns the maximum payload length of a packet given the `mtu`.
Returns the maximum payload length of a packet given the `mtu`.
Returns the maximum payload length of a packet given the ` mtu ` .
const fn max_icmp_payload_length(mtu: usize) -> usize {
    // Based on the following logic:
    // https://osscs.corp.google.com/fuchsia/fuchsia/+/main:third_party/golibs/vendor/gvisor.dev/gvisor/pkg/tcpip/network/ipv4/ipv4.go;l=402;drc=42abed01bbe5e1fb34f17f64f63f6e7ba27a74c7
    // The max payload length is rounded down to the nearest number that is
    // divisible by 8 bytes.
    ((mtu
        - packet_formats::ethernet::testutil::ETHERNET_HDR_LEN_NO_TAG
        - packet_formats::ipv4::testutil::IPV4_MIN_HDR_LEN)
        & !7)
        - ping::ICMP_HEADER_LEN
}
const fn max_icmp_payload_length ( mtu : usize ) -> usize { // Based on the following logic: // https://osscs.corp.google.com/fuchsia/fuchsia/+/main:third_party/golibs/vendor/gvisor.dev/gvisor/pkg/tcpip/network/ipv4/ipv4.go;l=402;drc=42abed01bbe5e1fb34f17f64f63f6e7ba27a74c7 // The max payload length is rounded down to the nearest number that is // divisible by 8 bytes. ( ( mtu - packet_formats :: ethernet :: testutil :: ETHERNET_HDR_LEN_NO_TAG - packet_formats :: ipv4 :: testutil :: IPV4_MIN_HDR_LEN ) & ! 7 ) - ping :: ICMP_HEADER_LEN }
Returns the maximum payload length of a packet given the `mtu`.
Returns the maximum payload length of a packet given the ` mtu ` .
mtu
usize
mtu
usize